Skip to content

Update str_to_bool function to include 'nope' as a valid false value#3080

Merged
ahopkins merged 4 commits into
sanic-org:mainfrom
tkosman:nope-as-bool-false
Nov 30, 2025
Merged

Update str_to_bool function to include 'nope' as a valid false value#3080
ahopkins merged 4 commits into
sanic-org:mainfrom
tkosman:nope-as-bool-false

Conversation

@tkosman

@tkosman tkosman commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

Let’s keep things fair.
If we're parsing 'yup' and 'yep' as bool type True.
Definitely 'nope' belongs to bool type False.

Example:

import os
import sanic

os.environ["SANIC_NOPE"] = "nope"

app = sanic.Sanic("Nope")

@app.route("/")
async def nope(request):
    return sanic.response.json({"NOPE IS": app.config.get("NOPE")}) # {NOPE IS: false}


if __name__ == "__main__":
    app.run()

@tkosman tkosman requested review from a team as code owners July 30, 2025 20:56
ahopkins
ahopkins previously approved these changes Nov 30, 2025
@codecov

codecov Bot commented Nov 30, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.643%. Comparing base (f240432) to head (4673835).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #3080   +/-   ##
=========================================
  Coverage   87.643%   87.643%           
=========================================
  Files          103       103           
  Lines         7729      7729           
  Branches      1225      1225           
=========================================
  Hits          6774      6774           
  Misses         660       660           
  Partials       295       295           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ahopkins ahopkins merged commit ebb0b5b into sanic-org:main Nov 30, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants