From aafda82ecfff49ae1f3e32220a8978e2b263aa57 Mon Sep 17 00:00:00 2001 From: Tobias Lidskog Date: Thu, 5 Dec 2019 23:34:12 +0100 Subject: [PATCH] Update pre-commit hooks. (#188) * Update pre-commit hooks. Results of running `pre-commit autoupdate`, and fixing resulting lint errors. Also make sure all hooks execute with python 3. * Make linter happy --- .pre-commit-config.yaml | 17 ++++++++++------- cartography/driftdetect/reporter.py | 1 - tests/data/okta/adminroles.py | 1 - tests/unit/cartography/intel/gsuite/test_api.py | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6fcc2caf5..ac779a382a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,9 @@ +default_language_version: + # force all unspecified python hooks to run python3 + python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.1.0 + rev: v2.3.0 hooks: - id: check-docstring-first - id: check-executables-have-shebangs @@ -11,32 +14,32 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.7 + rev: 3.7.8 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.4.3 + rev: v1.4.4 hooks: - id: autopep8 # disable a few rewrites which will cause autopep8 to reflow args: [--in-place, '--ignore=E265,E501,W504'] - repo: https://github.com/asottile/pyupgrade - rev: v1.14.0 + rev: v1.25.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v1.0.0 + rev: v1.4.1 hooks: - id: add-trailing-comma args: [--py36-plus] - repo: https://github.com/asottile/reorder_python_imports - rev: v1.4.0 + rev: v1.7.0 hooks: - id: reorder-python-imports args: [--py3-plus] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.700 + rev: v0.740 hooks: - id: mypy - repo: https://github.com/thlorenz/doctoc diff --git a/cartography/driftdetect/reporter.py b/cartography/driftdetect/reporter.py index 48dcaa7ccc..628dc40d97 100644 --- a/cartography/driftdetect/reporter.py +++ b/cartography/driftdetect/reporter.py @@ -1,4 +1,3 @@ - def report_drift_new(results, state_properties): """ Prints new additions in Query Results between two states. diff --git a/tests/data/okta/adminroles.py b/tests/data/okta/adminroles.py index 8fd6c12469..35741bcf8f 100644 --- a/tests/data/okta/adminroles.py +++ b/tests/data/okta/adminroles.py @@ -1,4 +1,3 @@ - LIST_ASSIGNED_USER_ROLE_RESPONSE = """ [ { diff --git a/tests/unit/cartography/intel/gsuite/test_api.py b/tests/unit/cartography/intel/gsuite/test_api.py index 19884b2966..74173aceaf 100644 --- a/tests/unit/cartography/intel/gsuite/test_api.py +++ b/tests/unit/cartography/intel/gsuite/test_api.py @@ -97,7 +97,7 @@ def test_sync_gsuite_groups(all_groups, load_gsuite_groups, cleanup_gsuite_group } api.sync_gsuite_groups(session, admin_client, gsuite_update_tag, common_job_param) groups = api.transform_groups(all_groups()) - load_gsuite_groups.assert_called_with(session, groups, gsuite_update_tag,) + load_gsuite_groups.assert_called_with(session, groups, gsuite_update_tag) cleanup_gsuite_groups.assert_called_once() sync_gsuite_members.assert_called_with(groups, session, admin_client, gsuite_update_tag)