Skip to content

Commit 94ef760

Browse files
Merge pull request #3016 from VWS-Python/chore/pylint-builtin-bans
Ban dynamic builtins and typing.cast in lint config
2 parents 710580d + 1ced42d commit 94ef760

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ lint.per-file-ignores."tests/*.py" = [
159159
lint.unfixable = [
160160
"ERA001",
161161
]
162+
lint.flake8-tidy-imports.banned-api."typing.cast".msg = "typing.cast is banned: use explicit type narrowing or a typed variable instead."
162163
lint.pydocstyle.convention = "google"
163164

164165
[tool.pylint]
@@ -199,6 +200,17 @@ MASTER.load-plugins = [
199200
# Allow loading of arbitrary C extensions. Extensions are imported into the
200201
# active Python interpreter and may run arbitrary code.
201202
MASTER.unsafe-load-any-extension = false
203+
DEPRECATED_BUILTINS.bad-functions = [
204+
# Use Pylint until Ruff can ban bare builtin calls, or until custom rules
205+
# make this removable:
206+
# https://github.com/astral-sh/ruff/issues/10079
207+
# https://github.com/astral-sh/ruff/issues/970
208+
"filter",
209+
"getattr",
210+
"hasattr",
211+
"map",
212+
"setattr",
213+
]
202214
# Enable the message, report, category or checker with the given id(s). You can
203215
# either give multiple identifier separated by comma (,) or put this option
204216
# multiple time (only on the command line, not in the configuration file where

0 commit comments

Comments
 (0)