Skip to content

Commit

Permalink
Add more hook
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Oct 8, 2024
1 parent 375ee65 commit 5c774d2
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 8 deletions.
42 changes: 41 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,44 @@ repos:
hooks:
- id: ruff
args:
- --fix
- --fix

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
args: [ "--autofix" ]
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
args: [ "--config", "./pyproject.toml" ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.11.2"
hooks:
- id: mypy
name: mypy-python
args: [ --config-file, "./pyproject.toml" ]
additional_dependencies:
[
types-PyYAML,
types-attrs,
attrs,
types-pytz,
types-requests,
types-python-dateutil,
apache-airflow,
]
files: ^dagfactory
39 changes: 32 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]

dependencies = [
"apache-airflow>=2.0",
"apache-airflow-providers-http",
Expand All @@ -36,14 +37,22 @@ dependencies = [


[project.optional-dependencies]
dev = [
"pytest>=6.0",
"black",
"pylint",
"pytest-cov",
"tox",
#dev = [
# "pytest>=6.0",
# "black",
# "pylint",
# "pytest-cov",
# "tox",
#]
tests = [
"pre-commit"
]

[tool.hatch.envs.tests]
dependencies = [
"dag-factory[tests]"
]

[project.urls]
Source = "https://github.com/astronomer/dag-factory"

Expand All @@ -61,4 +70,20 @@ python = ["3.9", "3.10", "3.11", "3.12"]
airflow = ["2.8", "2.9", "2.10"]

[tool.hatch.envs.tests.scripts]
type-check = " pre-commit run mypy --files dagfactory/*"
type-check = " pre-commit run mypy --files dagfactory/*"


[tool.black]
line-length = 120
target-version = ['py39', 'py310', 'py311', 'py312']

[tool.mypy]
strict = true

[tool.ruff]
line-length = 120
[tool.ruff.lint]
select = ["C901", "D300", "I", "F"]
ignore = ["F541"]
[tool.ruff.lint.mccabe]
max-complexity = 10

0 comments on commit 5c774d2

Please sign in to comment.