Skip to content

Commit

Permalink
Suppress PLW0603 Pylint (Ruff) linter error to adjust to Ruff 0.0.253
Browse files Browse the repository at this point in the history
  • Loading branch information
gertvdijk committed Feb 27, 2023
1 parent c3b9ddb commit 131e7ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ development = [
"pytest-cov",
"pytest",
"reuse",
"ruff>=0.0.252",
"ruff>=0.0.253",
"setuptools-scm[toml]>=6.2",
"twine",
"validate-pyproject[all]",
Expand Down Expand Up @@ -157,9 +157,10 @@ ignore = [
# "Relative imports from parent modules are banned"
# https://github.com/adamchainz/flake8-tidy-imports#ban-relative-imports
# is OK in tests or else it looks like 'tests' is an actual package...
# Fixed in 0.0.247 with
# https://github.com/charliermarsh/ruff/commit/4f927fbacc072290093eb70b41b23221a7386259
"TID252",

# "Using the global statement to update [...] is discouraged" is OK in tests.
"PLW0603",
]

[tool.ruff.isort]
Expand Down
2 changes: 1 addition & 1 deletion src/purepythonmilter/examples/append_header_ip/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main(*, bind_host: str, bind_port: int, log_level: str, headername: str) ->
By default it adds it like this:
X-MilterExample-Connect-IP: 1.2.3.4
"""
global _headername
global _headername # noqa: PLW0603
logging.basicConfig(level=getattr(logging, log_level))
_headername = headername
append_header_ip_milter.run_server(host=bind_host, port=bind_port)
Expand Down
2 changes: 1 addition & 1 deletion src/purepythonmilter/examples/change_body/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main(*, bind_host: str, bind_port: int, log_level: str, newbody: str) -> Non
"""
This Milter replaces the body with the value given in the `--newbody` parameter.
"""
global _newbody
global _newbody # noqa: PLW0603
logging.basicConfig(level=getattr(logging, log_level))
_newbody = newbody
change_body_milter.run_server(host=bind_host, port=bind_port)
Expand Down

0 comments on commit 131e7ae

Please sign in to comment.