Skip to content

Commit

Permalink
Merge pull request #87 from opengisch/ruff
Browse files Browse the repository at this point in the history
Add `ruff` configuration instead of flake
  • Loading branch information
suricactus authored Jul 3, 2024
2 parents 529ae52 + d6ec299 commit 6a4e2b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 33 deletions.
41 changes: 12 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
repos:
# Fix end of files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- '--fix=lf'

# Remove unused imports/variables
- repo: https://github.com/myint/autoflake
rev: v1.4
# Lint and format
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.4
hooks:
- id: autoflake
args:
- "--in-place"
- "--remove-all-unused-imports"
- "--remove-unused-variables"
- "--exclude=__init__.py"

# Sort imports
- repo: https://github.com/pycqa/isort
rev: "5.12.0"
hooks:
- id: isort
args: ["--profile", "black"]
# Run the linter.
- id: ruff
args: [ --fix ]

# Black formatting
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

# Lint files
- repo: https://github.com/pycqa/flake8
rev: "3.9.0"
hooks:
- id: flake8
# Run the formatter.
- id: ruff-format

# Static type-checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.3.0'
rev: 'v1.10.0'
hooks:
- id: mypy
additional_dependencies: []
1 change: 0 additions & 1 deletion libqfieldsync/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def __init__(
create_basemap: bool = True,
dirs_to_copy: Optional[Dict[str, bool]] = None,
):

super(OfflineConverter, self).__init__(parent=None)
self.__max_task_progress = 0
self.__convertor_progress = None # for processing feedback
Expand Down
2 changes: 0 additions & 2 deletions libqfieldsync/project_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __init__(


class ProjectCheckerFeedback:

tr = QObject().tr

def __init__(self) -> None:
Expand All @@ -63,7 +62,6 @@ def add(self, feedback: Feedback):


class ProjectChecker:

tr = QObject().tr

class CheckConfig(TypedDict):
Expand Down
1 change: 0 additions & 1 deletion libqfieldsync/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ def __init__(self, message, exception=None, long_message=None, tag="QFieldSync")

class NoProjectFoundError(QFieldSyncError):
def __init__(self, message, exception=None, long_message=None, tag="QFieldSync"):

# Call the base class constructor with the parameters it needs
super(NoProjectFoundError, self).__init__(message, exception, long_message, tag)

0 comments on commit 6a4e2b1

Please sign in to comment.