Explorar el Código

chore: update pre-commit config

Sean hace 3 años
padre
commit
93b6a4d1f9
Se han modificado 2 ficheros con 37 adiciones y 15 borrados
  1. 36 14
      .pre-commit-config.yaml
  2. 1 1
      ocma/connect.py

+ 36 - 14
.pre-commit-config.yaml

@@ -1,46 +1,64 @@
+exclude: ^(data/.*|.vscode/.*)$
+
 repos:
+  - repo: https://github.com/commitizen-tools/commitizen
+    # Please run `pre-commit install --hook-type commit-msg` to check commit messages
+    rev: v2.42.0
+    hooks:
+      - id: commitizen
+
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.3.0
+    rev: v4.4.0
     hooks:
       - id: check-yaml
+      - id: check-json
+      - id: check-toml
       - id: end-of-file-fixer
       - id: trailing-whitespace
+      - id: detect-private-key
       - id: check-case-conflict
       - id: check-ast
       - id: check-added-large-files
         args: ["--maxkb=1000"]
 
-  - repo: https://github.com/psf/black
-    rev: 22.8.0
+  - repo: https://github.com/codespell-project/codespell.git
+    rev: v2.2.2
     hooks:
-      - id: black
+      - id: codespell
+        name: codespell
 
-  - repo: https://github.com/pre-commit/mirrors-prettier
-    rev: v2.7.1
+  - repo: https://github.com/asottile/pyupgrade
+    rev: v3.3.1
     hooks:
-      - id: prettier
+      - id: pyupgrade
+        args: [--py39-plus]
+
+  - repo: https://github.com/psf/black
+    rev: 23.1.0
+    hooks:
+      - id: black
 
   - repo: https://github.com/pycqa/isort
-    rev: 5.10.1
+    rev: 5.12.0
     hooks:
       - id: isort
         name: isort (python)
 
   - repo: https://github.com/PyCQA/pydocstyle
-    rev: 6.1.1
+    rev: 6.3.0
     hooks:
       - id: pydocstyle
         name: pydocstyle
 
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v0.971
+    rev: v1.0.1
     hooks:
       - id: mypy
         name: mypy
-        additional_dependencies: ["requests"]
+        additional_dependencies: ["types-pytz"]
 
   - repo: https://github.com/pycqa/pylint
-    rev: v2.15.3
+    rev: v2.16.2
     hooks:
       - id: pylint
         types: [python]
@@ -51,11 +69,15 @@ repos:
         name: Install project deps
         entry: poetry install
         language: system
-        always_run: true
+        always_run: false
+        types: [python]
         pass_filenames: false
+        stages: [commit, merge-commit, push, manual]
       - id: run-tests
         name: Run tests
         entry: poetry run pytest
         language: system
-        always_run: true
+        always_run: false
+        types: [python]
         pass_filenames: false
+        stages: [commit, merge-commit, push, manual]

+ 1 - 1
ocma/connect.py

@@ -210,7 +210,7 @@ def _fill_mfa(driver: webdriver.Firefox, mfa_secret: Optional[str]) -> None:
 
 
 def _confirm_stay_signed_in(driver: webdriver.Firefox) -> bool:
-    LOGGER.info("Cheking if we should confirm if we should stay signed in")
+    LOGGER.info("Checking if we should confirm if we should stay signed in")
 
     if not _is_on_ms_login_page(driver):
         LOGGER.info("Already logged in, can't confirm 'stay signed in'")