Skip to content

Commit

Permalink
chore: fix F841 errors reported by flake8
Browse files Browse the repository at this point in the history
Local variable name is assigned to but never used

https://www.flake8rules.com/rules/F841.html
  • Loading branch information
JohnVillalovos committed Apr 18, 2021
1 parent ff21eb6 commit 40f4ab2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/lint.yml
Expand Up @@ -12,14 +12,6 @@ env:
PY_COLORS: 1

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
black_args: ". --check"
commitlint:
runs-on: ubuntu-latest
steps:
Expand All @@ -28,10 +20,15 @@ jobs:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v3

mypy:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade tox
- run: tox -e mypy
- name: Run black code formatter (https://black.readthedocs.io/en/stable/)
run: tox -e black -- --check
- name: Run flake8 (https://flake8.pycqa.org/en/latest/)
run: tox -e pep8
- name: Run mypy static typing checker (http://mypy-lang.org/)
run: tox -e mypy
1 change: 0 additions & 1 deletion gitlab/cli.py
Expand Up @@ -162,7 +162,6 @@ def docs() -> argparse.ArgumentParser:
if "sphinx" not in sys.modules:
sys.exit("Docs parser is only intended for build_sphinx")

parser = _get_base_parser(add_help=False)
# NOTE: We must delay import of gitlab.v4.cli until now or
# otherwise it will cause circular import errors
import gitlab.v4.cli
Expand Down
2 changes: 1 addition & 1 deletion gitlab/tests/objects/test_appearance.py
Expand Up @@ -63,4 +63,4 @@ def test_get_update_appearance(gl, resp_application_appearance):


def test_update_appearance(gl, resp_application_appearance):
resp = gl.appearance.update(title=new_title, description=new_description)
gl.appearance.update(title=new_title, description=new_description)
2 changes: 1 addition & 1 deletion gitlab/tests/test_base.py
Expand Up @@ -92,7 +92,7 @@ def test_picklability(self, fake_manager):
assert isinstance(unpickled, FakeObject)
assert hasattr(unpickled, "_module")
assert unpickled._module == original_obj_module
pickled2 = pickle.dumps(unpickled)
pickle.dumps(unpickled)

def test_attrs(self, fake_manager):
obj = FakeObject(fake_manager, {"foo": "bar"})
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/todos.py
Expand Up @@ -48,4 +48,4 @@ def mark_all_as_done(self, **kwargs):
Returns:
int: The number of todos maked done
"""
result = self.gitlab.http_post("/todos/mark_as_done", **kwargs)
self.gitlab.http_post("/todos/mark_as_done", **kwargs)
6 changes: 5 additions & 1 deletion tox.ini
Expand Up @@ -52,7 +52,11 @@ commands = {posargs}
[flake8]
exclude = .git,.venv,.tox,dist,doc,*egg,build,
max-line-length = 88
ignore = E501,H501,H803,W503
# We ignore the following because we use black to handle code-formatting
# E203: Whitespace before ':'
# E501: Line too long
# W503: Line break occurred before a binary operator
ignore = E203,E501,W503
per-file-ignores =
gitlab/v4/objects/__init__.py:F401,F403

Expand Down

0 comments on commit 40f4ab2

Please sign in to comment.