Debian Codegraph @

pyproject.toml

raw symbols SCIP
1 [build-system]
2 requires = ["hatchling", "hatch-vcs"]
3 build-backend = "hatchling.build"
4
5 [project]
6 name = "gitlint"
7 dynamic = ["version", "dependencies", "urls"]
8 description = "Git commit message linter written in python, checks your commit messages for style."
9 readme = "README.md"
10
11 license = "MIT"
12 requires-python = ">=3.7"
13 authors = [{ name = "Joris Roovers" }]
14 keywords = [
15 "git",
16 "gitlint",
17 "lint", #
18 ]
19 classifiers = [
20 "Development Status :: 5 - Production/Stable",
21 "Environment :: Console",
22 "Intended Audience :: Developers",
23 "License :: OSI Approved :: MIT License",
24 "Operating System :: OS Independent",
25 "Programming Language :: Python",
26 "Programming Language :: Python :: 3.7",
27 "Programming Language :: Python :: 3.8",
28 "Programming Language :: Python :: 3.9",
29 "Programming Language :: Python :: 3.10",
30 "Programming Language :: Python :: 3.11",
31 "Programming Language :: Python :: Implementation :: CPython",
32 "Programming Language :: Python :: Implementation :: PyPy",
33 "Topic :: Software Development :: Quality Assurance",
34 "Topic :: Software Development :: Testing",
35 ]
36
37 [tool.hatch.version]
38 source = "vcs"
39
40 [tool.hatch.build]
41 exclude = ["*"]
42
43 [tool.hatch.metadata.hooks.vcs.urls]
44 Homepage = "https://jorisroovers.github.io/gitlint"
45 Documentation = "https://jorisroovers.github.io/gitlint"
46 Source = "https://github.com/jorisroovers/gitlint"
47 Changelog = "https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md"
48 # TODO(jorisroovers): Temporary disable until fixed in hatch-vcs (see #460)
49 # 'Source Archive' = "https://github.com/jorisroovers/gitlint/archive/{commit_hash}.zip"
50 # 'Source Commit' = "https://github.com/jorisroovers/gitlint/tree/{commit_hash}"
51
52 # Use metadata hooks specified in 'hatch_build.py'
53 # (this line is critical when building wheels, when building sdist it seems optional)
54 [tool.hatch.metadata.hooks.custom]
55
56 # Environments #########################################################################################################
57 # NOTE: By default all environments inherit from the 'default' environment
58
59 # DEV
60 # Workaround for editable install:
61 # https://github.com/pypa/hatch/issues/588
62 [tool.hatch.envs.dev]
63 description = """
64 Dev environment (running gitlint itself from source)
65 """
66 pre-install-commands = [
67 "pip install -e ./gitlint-core", #
68 ]
69
70 [tool.hatch.envs.dev.scripts]
71 fullclean = [
72 "rm .coverage .coverage.lcov",
73 "rm -rf site dist .pytest_cache",
74 "rm -rf gitlint-core/dist gitlint-core/build gitlint-core/.pytest_cache",
75 "rm -rf qa/__pycache__ qa/.pytest_cache",
76 ]
77
78 # TEST
79 [tool.hatch.envs.test]
80 description = """
81 Test environment (unit tests, formatting, lint)
82 """
83 skip-install = true
84 dependencies = [
85 "gitlint-core[trusted-deps] @ {root:uri}/gitlint-core",
86 "black==23.1.0",
87 "pytest==7.2.1",
88 "pytest-cov==4.0.0",
89 "python-coveralls==2.9.3",
90 "ruff==0.0.252",
91 "radon==5.1.0",
92 "pdbr==0.8.2; sys_platform != \"win32\"",
93 ]
94
95 [tool.hatch.envs.test.scripts]
96 unit-tests = [
97 "pytest --cov=gitlint-core --cov-report=term --cov-report=lcov:.coverage.lcov -rw -s {args:gitlint-core}",
98 ]
99 u = "unit-tests"
100 unit-tests-no-cov = "pytest -rw -s {args:gitlint-core}"
101 format = "black --check --diff {args:.}"
102 lint = "ruff {args:gitlint-core/gitlint qa}"
103 autoformat = "black {args:.}"
104 autofix = [
105 "ruff --fix {args:gitlint-core/gitlint qa}",
106 "autoformat", #
107 ]
108
109 all = [
110 "unit-tests",
111 "format",
112 "lint", #
113 ]
114 stats = ["./tools/stats.sh"]
115
116 # QA
117 [tool.hatch.envs.qa]
118 description = """
119 Integration test environment.
120 Run a set of integration tests against any gitlint binary (not just the one from local source).
121 """
122 detached = true
123 dependencies = [
124 "pytest==7.2.1",
125 "arrow==1.2.3",
126 "sh==1.14.3; sys_platform != \"win32\"",
127 "pdbr==0.8.2; sys_platform != \"win32\"",
128 ]
129
130 [tool.hatch.envs.qa.scripts]
131 # The integration tests can be ran against any gitlint binary, e.g. one installed from pypi (for post-release testing)
132 # This is why by default we don't install the local dev version of gitlint in the qa environment
133 # To run integration tests against the dev version of gitlint, use install-local first
134 install-local = "pip install -e ./gitlint-core[trusted-deps]"
135 integration-tests = "pytest -rw -s {args:qa}"
136 i = "integration-tests"
137
138
139 # DOCS
140 [tool.hatch.envs.docs]
141 description = """
142 Documentation environment. Run docs build and serve commands.
143 """
144 detached = true
145 dependencies = [
146 "mkdocs==1.4.2", #
147 ]
148
149 [tool.hatch.envs.docs.scripts]
150 build = "mkdocs build --clean --strict"
151 serve = "mkdocs serve"
152
153 # Tool config ##########################################################################################################
154
155 [tool.black]
156 target_version = ['py37', 'py38', 'py39', 'py310']
157 line-length = 120
158 # extend-exclude: keep excluding files from .gitignore in addition to the ones specified
159 extend-exclude = "gitlint-core/gitlint/tests/samples/user_rules/import_exception/invalid_python.py"
160
161 [tool.ruff]
162 target-version = "py37"
163 extend-exclude = [
164 "gitlint-core/gitlint/tests/samples/user_rules/import_exception/invalid_python.py",
165 ]
166
167 ignore = [
168 "E501", # Never enforce `E501` (line length violations) - taken care of by black
169 "SIM108", # Use ternary operator instead of if-else-block
170 "PLR0913", # Too many arguments to function call
171 ]
172
173 select = [
174 "F", # PyFlakes
175 "E", # Pycodestyle
176 "W", # Pycodestyle
177 "I", # isort (import order)
178 "YTT", # flake8-2020 (misuse of sys.version)
179 "S", # flake8-bandit (security)
180 "B", # flake8-bugbear
181 "C4", # flake8-comprehensions (correct use of comprehensions)
182 "T10", # flake8-debugger (no debug statements)
183 "T20", # flake8-print (no print statements)
184 "SIM", # flake8-simplify (use simple code)
185 "TID", # flake8-tidy-imports (correct import syntax)
186 "ARG", # flake8-unused-arguments (no unused function arguments)
187 "DTZ", # flake8-datetimez (correct datetime usage)
188 "ERA", # eradicate (no commented out code)
189 "UP", # pyupgrade (modern python syntax)
190 "PLC", # pylint
191 "PLE", # pylint
192 "PLR", # pylint
193 "PLW", # pylint
194 "PIE", # flake8-pie
195 "RUF", # ruff specific
196 ]
197
198 [tool.coverage.run]
199 branch = true # measure branch coverage in addition to statement coverage
200
201 [tool.coverage.report]
202 fail_under = 97
203 show_missing = true