Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Aug 21, 2024
1 parent b5ef523 commit fa03c48
Show file tree
Hide file tree
Showing 8 changed files with 576 additions and 453 deletions.
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: ruff
- id: ruff-format
- repo: local
hooks:
- id: vulture
name: vulture
language: system
pass_filenames: false
entry: poetry run vulture mypy_boto3_builder vulture_whitelist.txt
- id: pyright
name: pyright
language: system
pass_filenames: false
entry: poetry run pyright mypy_boto3_builder
- id: mypy
name: mypy
language: system
pass_filenames: false
entry: poetry run mypy mypy_boto3_builder
- id: pytest
name: pytest
language: system
pass_filenames: false
entry: poetry run pytest
2 changes: 1 addition & 1 deletion mypy_boto3_builder/utils/type_def_sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def sort(self) -> list[TypeDefSortable]:
)
type_def.stringify()

self.logger.warn("Topological sort failed, stringifying TypedDicts")
self.logger.warning("Topological sort failed, stringifying TypedDicts")
return self._sort_stringified()

def _get(self, *names: str) -> list[TypeDefSortable]:
Expand Down
980 changes: 535 additions & 445 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ types-urllib3 = "*"
types-s3transfer = "*"
boto3-stubs = "*"
botocore-stubs = "*"
pre-commit = "*"

[tool.poetry.group.ci.dependencies]
mypy = "*"
Expand Down Expand Up @@ -193,7 +194,7 @@ ignore = [
fixable = ["ALL"]
unfixable = ["B"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
exclude = ["test_*.py", "*.pyi"]
exclude = ["test_*.py", "*.pyi", "examples/*", "aio_examples/*"]

[tool.ruff.format]
quote-style = "double"
Expand Down
7 changes: 1 addition & 6 deletions scripts/before_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ ROOT_PATH=$(dirname $(dirname $0))
cd $ROOT_PATH

# poetry run vulture mypy_boto3_builder --make-whitelist > vulture_whitelist.txt
poetry run vulture mypy_boto3_builder vulture_whitelist.txt
poetry run pyright mypy_boto3_builder
poetry run mypy mypy_boto3_builder
poetry run pytest
poetry run ruff check mypy_boto3_builder
poetry run ruff format --check
poetry run pre-commit run --all-files

poetry run ruff check scripts --target-version py38
poetry run pyright scripts --pythonversion 3.8
Expand Down
3 changes: 3 additions & 0 deletions tests/writers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Tests for the writers module.
"""
3 changes: 3 additions & 0 deletions types_boto3/types_boto3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Main entrypoint for the types_boto3 package.
"""
3 changes: 3 additions & 0 deletions types_botocore/types_botocore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Main entrypoint for the types_botocore package.
"""

0 comments on commit fa03c48

Please sign in to comment.