Skip to content

Commit

Permalink
ci: Run pre-commit --all-files on ci to lint project
Browse files Browse the repository at this point in the history
  • Loading branch information
jairhenrique committed Dec 13, 2023
1 parent 2de9251 commit 7ce633f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Run pre-commit

on:
- pull_request
- push
- workflow_dispatch

jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ venv.bak/
.mypy_cache/

# PyCharm
.idea/
.idea/
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,7 +13,7 @@ repos:
- id: debug-statements

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.1.0
hooks:
- id: flake8

Expand All @@ -23,14 +23,14 @@ repos:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.7.1
hooks:
- id: mypy
additional_dependencies:
- types-attrs
- types-boto3

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.1
hooks:
- id: isort
1 change: 1 addition & 0 deletions sqs_workers/async_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Optional,
TypeVar,
)

from typing_extensions import ParamSpec

from sqs_workers.utils import bind_arguments
Expand Down
3 changes: 1 addition & 2 deletions sqs_workers/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
Optional,
TypeVar,
)
from typing_extensions import ParamSpec


import attr
from typing_extensions import ParamSpec

from sqs_workers import DEFAULT_BACKOFF, codecs
from sqs_workers.async_task import AsyncTask
Expand Down
4 changes: 2 additions & 2 deletions sqs_workers/sqs_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
Union,
overload,
)
from typing_extensions import ParamSpec

import attr
import boto3
from typing_extensions import ParamSpec

from sqs_workers import DEFAULT_BACKOFF, RawQueue, codecs, context, processors
from sqs_workers.async_task import AsyncTask
from sqs_workers.batching import BatchingConfiguration, NoBatching
from sqs_workers.core import RedrivePolicy
from sqs_workers.processors import DEFAULT_CONTEXT_VAR
from sqs_workers.queue import GenericQueue, JobQueue
from sqs_workers.shutdown_policies import NeverShutdown
from sqs_workers.async_task import AsyncTask

if TYPE_CHECKING:
from sqs_workers.backoff_policies import BackoffPolicy
Expand Down

0 comments on commit 7ce633f

Please sign in to comment.