Skip to content

Commit

Permalink
Disable S101 by default
Browse files Browse the repository at this point in the history
S101 flags every `assert` statement. `assert` statement
aren't generally considered to be an anti-pattern,
so this commit disables the rule by default.
  • Loading branch information
not-my-profile committed Jan 28, 2023
1 parent 57d1e13 commit f0e5b7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ For more, see [flake8-bandit](https://pypi.org/project/flake8-bandit/) on PyPI.

| Code | Name | Message | Fix |
| ---- | ---- | ------- | --- |
| S101 | assert-used | Use of `assert` detected | |
| S102 | exec-used | Use of `exec` detected | |
| S103 | bad-file-permissions | `os.chmod` setting a permissive mask `{mask:#o}` on file or directory | |
| S104 | hardcoded-bind-all-interfaces | Possible binding to all interfaces | |
Expand All @@ -791,6 +790,11 @@ For more, see [flake8-bandit](https://pypi.org/project/flake8-bandit/) on PyPI.
| S612 | logging-config-insecure-listen | Use of insecure `logging.config.listen` detected | |
| S701 | jinja2-autoescape-false | Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. | |


The following rules have been disabled by default:

* S101 (assert-used): `assert` is generally not considered to be an anti-pattern.

### flake8-blind-except (BLE)

For more, see [flake8-blind-except](https://pypi.org/project/flake8-blind-except/) on PyPI.
Expand Down
1 change: 0 additions & 1 deletion scripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ignore = [
"E501", # line-too-long
"INP001", # implicit-namespace-package
"PLR2004", # magic-value-comparison
"S101", # assert-used
"EM"
]

Expand Down
1 change: 1 addition & 0 deletions src/settings/nursery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub fn nursery_reason(rule: &Rule) -> Option<&'static str> {
Rule::OneBlankLineBeforeClass => Some("Conflicts with PEP 257."),
Rule::MultiLineSummaryFirstLine => Some("Not part of PEP 257 and conflicts with D213."),
Rule::MultiLineSummarySecondLine => Some("Not part of PEP 257 and conflicts with D212."),
Rule::AssertUsed => Some("`assert` is generally not considered to be an anti-pattern."),
_ => None,
}
}

0 comments on commit f0e5b7f

Please sign in to comment.