diff options
author | John L. Villalovos <john@sodarock.com> | 2021-04-17 14:59:35 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-04-18 08:26:07 -0700 |
commit | 40f4ab20ba0903abd3d5c6844fc626eb264b9a6a (patch) | |
tree | b4b8ca325f0e96a2d07c0bf0b3e99153ef7f4f56 | |
parent | ff21eb664871904137e6df18308b6e90290ad490 (diff) | |
download | gitlab-40f4ab20ba0903abd3d5c6844fc626eb264b9a6a.tar.gz |
chore: fix F841 errors reported by flake8
Local variable name is assigned to but never used
https://www.flake8rules.com/rules/F841.html
-rw-r--r-- | .github/workflows/lint.yml | 17 | ||||
-rw-r--r-- | gitlab/cli.py | 1 | ||||
-rw-r--r-- | gitlab/tests/objects/test_appearance.py | 2 | ||||
-rw-r--r-- | gitlab/tests/test_base.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/todos.py | 2 | ||||
-rw-r--r-- | tox.ini | 6 |
6 files changed, 15 insertions, 15 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c11810..556a186 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: @@ -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 diff --git a/gitlab/cli.py b/gitlab/cli.py index ce50406..0a97ed7 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -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 diff --git a/gitlab/tests/objects/test_appearance.py b/gitlab/tests/objects/test_appearance.py index 7c52301..43ea574 100644 --- a/gitlab/tests/objects/test_appearance.py +++ b/gitlab/tests/objects/test_appearance.py @@ -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) diff --git a/gitlab/tests/test_base.py b/gitlab/tests/test_base.py index 2fa4b1a..aac9af6 100644 --- a/gitlab/tests/test_base.py +++ b/gitlab/tests/test_base.py @@ -92,7 +92,7 @@ class TestRESTObject: 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"}) diff --git a/gitlab/v4/objects/todos.py b/gitlab/v4/objects/todos.py index 33ad7ee..7dc7a51 100644 --- a/gitlab/v4/objects/todos.py +++ b/gitlab/v4/objects/todos.py @@ -48,4 +48,4 @@ class TodoManager(ListMixin, DeleteMixin, RESTManager): 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) @@ -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 |