From 16b48ec2b51de4c9a123e44a8db6fb61a4da866e Mon Sep 17 00:00:00 2001 From: Artem Rys <79191415+arys-splunk@users.noreply.github.com> Date: Wed, 6 Apr 2022 11:06:48 +0200 Subject: [PATCH] chore: remove actionlint (#159) * chore: remove actionlint * style: run pre-commit --- .github/workflows/build-test-release.yml | 3 --- .gitignore | 3 ++- .pre-commit-config.yaml | 13 ++----------- solnlib/credentials.py | 2 +- solnlib/utils.py | 2 +- tests/unit/test_utils.py | 2 +- 6 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 7b568d32..da07ef99 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -57,9 +57,6 @@ jobs: - uses: actions/setup-python@v3 with: python-version: "3.7" - - name: Install actionlint - run: | - bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.6.8/scripts/download-actionlint.bash) - uses: pre-commit/action@v2.0.3 review_secrets: diff --git a/.gitignore b/.gitignore index 4a691d27..365d1fd6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.DS_Store* __pycache__ *.pyc -*.pyo \ No newline at end of file +*.pyo +.coverage \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f24a35e8..2af950e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.31.1 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/psf/black - rev: 21.12b0 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/PyCQA/isort @@ -22,12 +22,3 @@ repos: hooks: - id: docformatter args: [--in-place] -- repo: local - hooks: - - id: actionlint - name: actionlint - entry: actionlint - args: [-ignore, 'property ".+" is not defined in object type'] - language: script - types: ["yaml"] - files: ^.github/workflows/ diff --git a/solnlib/credentials.py b/solnlib/credentials.py index 58247396..add21c73 100644 --- a/solnlib/credentials.py +++ b/solnlib/credentials.py @@ -243,7 +243,7 @@ def _get_all_passwords(self): all_passwords = self._storage_passwords.list(count=-1) results = {} - ptn = re.compile(fr"(.+){self.SEP}(\d+)") + ptn = re.compile(rf"(.+){self.SEP}(\d+)") for password in all_passwords: match = ptn.match(password.name) if match: diff --git a/solnlib/utils.py b/solnlib/utils.py index e21d0b73..fda4264a 100644 --- a/solnlib/utils.py +++ b/solnlib/utils.py @@ -162,7 +162,7 @@ def wrapper(*args, **kwargs): ): last_ex = e if i < max_tries - 1: - time.sleep(2 ** i) + time.sleep(2**i) else: raise diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 41dfaf5e..08d13b18 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -93,7 +93,7 @@ def mock_func(): mock_func() assert tried[0] == retries + 1 - assert mock_sleep_time[0] == sum(2 ** i for i in range(retries)) + assert mock_sleep_time[0] == sum(2**i for i in range(retries)) record = [0, 0]