11[tool .poetry ]
2- name = " app "
2+ name = " python-template-x "
33version = " 0.0.0"
44description = " This is a python template."
55authors = [" Mark Beacom <m@beacom.dev>" ]
@@ -38,19 +38,108 @@ line-length = 120
3838target-version = [" py311" ]
3939
4040[tool .ruff ]
41+ # Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default.
42+ # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
43+ # McCabe complexity (`C901`) by default.
44+ select = [
45+ " E" , # pycodestyle errors
46+ " F" , # pyflakes
47+ " B" , # bugbear
48+ " W" , # pycodestyle warnings
49+ " C90" , # McCabe complexity
50+ " I" , # isort
51+ " N" , # pep8-naming
52+ " D" , # pydocstyle
53+ " UP" , # pyupgrade
54+ " ANN" , # flake8-annotations
55+ " S" , # bandit
56+ " ASYNC" , # flake8-async
57+ " BLE" , # flake8-blind-except
58+ " FBT" , # flake8-boolean-trap
59+ " A" , # flake8-builtins
60+ " COM" , # flake8-commas
61+ " C4" , # flake8-comprehensions
62+ " DTZ" , # flake8-datetimez
63+ " T10" , # flake8-debugger
64+ " EM" , # flake8-errmsg
65+ " EXE" , # flake8-executable
66+ " FA" , # flake8-future-annotations
67+ " ISC" , # flake8-implicit-str-concat
68+ " G" , # flake8-logging-format
69+ " PT" , # flake8-pytest-style
70+ " Q" , # flake8-quotes
71+ " RSE" , # flake8-raise
72+ " RET" , # flake8-return
73+ " SLF" , # flake8-self
74+ " SLOT" , # flake8-slots
75+ " SIM" , # flake8-simplify
76+ " TCH" , # flake8-type-checking
77+ " FLY" , # flynt
78+ ]
79+ # Ignore E501 (bugbear line length) by default.
80+ ignore = [
81+ " E501" , # line-too-long
82+ " D203" , # one-blank-line-before-class
83+ " D213" , # multi-line-summary-second-line - Multi-line docstring summary should start at the second line
84+ ]
85+
86+ # Allow autofix for all enabled rules (when `--fix`) is provided.
87+ fixable = [" ALL" ]
88+ unfixable = []
89+
90+ # Exclude a variety of commonly ignored directories.
91+ exclude = [
92+ " .bzr" ,
93+ " .direnv" ,
94+ " .eggs" ,
95+ " .git" ,
96+ " .git-rewrite" ,
97+ " .hg" ,
98+ " .mypy_cache" ,
99+ " .nox" ,
100+ " .pants.d" ,
101+ " .pytype" ,
102+ " .ruff_cache" ,
103+ " .svn" ,
104+ " .tox" ,
105+ " .venv" ,
106+ " __pypackages__" ,
107+ " _build" ,
108+ " buck-out" ,
109+ " build" ,
110+ " dist" ,
111+ " node_modules" ,
112+ " venv" ,
113+ ]
114+
115+ # Same as our 120 Black setting.
41116line-length = 120
117+
118+ # Allow unused variables when underscore-prefixed.
119+ dummy-variable-rgx = " ^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
120+
121+ # Assume Python 3.11.
42122target-version = " py311"
43123
124+ [tool .ruff .per-file-ignores ]
125+ "tests/**/*.py" = [
126+ " S101" , # Ignore assert statements in tests
127+ " ARG" , # Ignore unused function args, e.g., fixtures
128+ " FBT" , # Ignore booleans as positional arguments in tests, e.g., @pytest.mark.parametrize()
129+ ]
130+
44131[tool .poe .tasks ]
45132isort = " isort --profile=black ."
46133black = " black ."
47134check-black = {cmd = " black . --check --diff" , help = " Validate styling with black" }
48135check-isort = {cmd = " isort --check --profile=black ." , help = " Validate import ordering with isort" }
49- check-docstrings = " pydocstyle -e ."
136+ update-precommit-hooks = {cmd = " pre-commit autoupdate --freeze" , help = " Update pre-commit hooks and freeze to SHAs" }
137+ check-precommit-hooks = {cmd = " pre-commit run --all-files" , help = " Run pre-commit hooks on all files" }
50138check-ruff = " ruff check python_template"
51- check = [" check-isort" , " check-black" ]
52- lint = [" check-docstrings" , " check-ruff" ]
53- fix = [" isort" , " black" , " ruff" ]
139+ check-mypy = " mypy python_template"
140+ check = [" check-ruff" , " check-isort" , " check-black" , " check-mypy" ]
141+ lint = [" ruff" ]
142+ fix = [" ruff" , " isort" , " black" ]
54143test = " pytest --cov=python_template --cov-report=xml --cov-report=term"
55144ruff = " ruff check --fix python_template"
56145safety = " safety check"
@@ -64,26 +153,27 @@ build = "poetry build"
64153python = " ^3.8"
65154typer = {extras = [" all" ], version = " ^0.9.0" }
66155
67-
68156[tool .poetry .group .test .dependencies ]
69157pytest = " ^7.4.0"
70158pytest-cov = " ^4.1.0"
71159coverage = " ^7.2.7"
72160
73-
74161[tool .poetry .group .dev .dependencies ]
75162isort = {extras = [" toml" ], version = " ^5.12.0" }
76163black = " ^23.3.0"
77- pydocstyle = " ^6.3.0"
78164mypy = " ^1.4.1"
79165debugpy = " ^1.6.7"
80166ruff = " ^0.0.277"
81-
167+ poethepoet = " ^0.20.0 "
82168
83169[tool .poetry .group .security .dependencies ]
84170safety = " ^2.3.5"
85171bandit = {extras = [" toml" ], version = " ^1.7.5" }
86172
173+ [tool .poetry .group .docs .dependencies ]
174+ mkdocs = " ^1.4.3"
175+ mkdocs-material = " ^9.1.18"
176+ mkdocstrings = {extras = [" python" ], version = " ^0.22.0" }
87177
88178[build-system ]
89179requires = [" poetry-core" ]
0 commit comments