Skip to content

Commit

Permalink
Merge pull request #47 from camptocamp/update-pre-commit-config
Browse files Browse the repository at this point in the history
Update pre-commit config
  • Loading branch information
sebalix authored Nov 13, 2023
2 parents f6635b3 + d93979a commit d89f4d7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
/.venv
/.ruff_cache

# Distribution / packaging
.Python
Expand Down
35 changes: 5 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ exclude: |
default_language_version:
python: python3
repos:
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
- id: autoflake
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand All @@ -37,19 +22,9 @@ repos:
- id: check-merge-conflict
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
exclude: /__init__\.py$
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
2 changes: 2 additions & 0 deletions oca_port/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__all__ = ["App"]

from .app import App
4 changes: 3 additions & 1 deletion oca_port/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
__all__ = ["cache", "git", "github", "misc", "storage"]

from . import cache
from . import git
from . import github
from . import misc
from . import storage
from . import cache
2 changes: 1 addition & 1 deletion oca_port/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SmartDict(dict):

def __getattr__(self, attrib):
val = self.get(attrib)
return self.__class__(val) if type(val) is dict else val
return self.__class__(val) if isinstance(val, dict) else val


REF_REGEX = r"((?P<org>[\w-]+)/)?((?P<repo>[\w-]+)#)?(?P<branch>.*)"
Expand Down
1 change: 0 additions & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class CommonCase(unittest.TestCase):

_settings = {
"branch1": "15.0",
"remote_branch1": "origin/15.0",
Expand Down

0 comments on commit d89f4d7

Please sign in to comment.