← 返回首页
chore: fix F841 errors reported by flake8 · python-gitlab/python-gitlab@40f4ab2 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit 40f4ab2

Browse files
chore: fix F841 errors reported by flake8
Local variable name is assigned to but never used https://www.flake8rules.com/rules/F841.html
1 parent ff21eb6 commit 40f4ab2

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎.github/workflows/lint.yml‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ env:
1212
PY_COLORS: 1
1313

1414
jobs:
15-
black:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-python@v2
20-
- uses: psf/black@stable
21-
with:
22-
black_args: ". --check"
2315
commitlint:
2416
runs-on: ubuntu-latest
2517
steps:
@@ -28,10 +20,15 @@ jobs:
2820
fetch-depth: 0
2921
- uses: wagoid/commitlint-github-action@v3
3022

31-
mypy:
23+
linters:
3224
runs-on: ubuntu-latest
3325
steps:
3426
- uses: actions/checkout@v2
3527
- uses: actions/setup-python@v2
3628
- run: pip install --upgrade tox
37-
- run: tox -e mypy
29+
- name: Run black code formatter (https://black.readthedocs.io/en/stable/)
30+
run: tox -e black -- --check
31+
- name: Run flake8 (https://flake8.pycqa.org/en/latest/)
32+
run: tox -e pep8
33+
- name: Run mypy static typing checker (http://mypy-lang.org/)
34+
run: tox -e mypy

‎gitlab/cli.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ def docs() -> argparse.ArgumentParser:
162162
if "sphinx" not in sys.modules:
163163
sys.exit("Docs parser is only intended for build_sphinx")
164164

165-
parser = _get_base_parser(add_help=False)
166165
# NOTE: We must delay import of gitlab.v4.cli until now or
167166
# otherwise it will cause circular import errors
168167
import gitlab.v4.cli

‎gitlab/tests/objects/test_appearance.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ def test_get_update_appearance(gl, resp_application_appearance):
6363

6464

6565
def test_update_appearance(gl, resp_application_appearance):
66-
resp = gl.appearance.update(title=new_title, description=new_description)
66+
gl.appearance.update(title=new_title, description=new_description)

‎gitlab/tests/test_base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_picklability(self, fake_manager):
9292
assert isinstance(unpickled, FakeObject)
9393
assert hasattr(unpickled, "_module")
9494
assert unpickled._module == original_obj_module
95-
pickled2 = pickle.dumps(unpickled)
95+
pickle.dumps(unpickled)
9696

9797
def test_attrs(self, fake_manager):
9898
obj = FakeObject(fake_manager, {"foo": "bar"})

‎gitlab/v4/objects/todos.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ def mark_all_as_done(self, **kwargs):
4848
Returns:
4949
int: The number of todos maked done
5050
"""
51-
result = self.gitlab.http_post("/todos/mark_as_done", **kwargs)
51+
self.gitlab.http_post("/todos/mark_as_done", **kwargs)

‎tox.ini‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ commands = {posargs}
5252
[flake8]
5353
exclude = .git,.venv,.tox,dist,doc,*egg,build,
5454
max-line-length = 88
55-
ignore = E501,H501,H803,W503
55+
# We ignore the following because we use black to handle code-formatting
56+
# E203: Whitespace before ':'
57+
# E501: Line too long
58+
# W503: Line break occurred before a binary operator
59+
ignore = E203,E501,W503
5660
per-file-ignores =
5761
gitlab/v4/objects/__init__.py:F401,F403
5862

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.