| 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 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
[tool.hatch.metadata.hooks.custom] |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 132 |
|
| 133 |
|
| 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 |
|
| 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 |
|
| 154 |
|
| 155 |
[tool.black] |
| 156 |
target_version = ['py37', 'py38', 'py39', 'py310'] |
| 157 |
line-length = 120 |
| 158 |
|
| 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", |
| 169 |
"SIM108", |
| 170 |
"PLR0913", |
| 171 |
] |
| 172 |
|
| 173 |
select = [ |
| 174 |
"F", |
| 175 |
"E", |
| 176 |
"W", |
| 177 |
"I", |
| 178 |
"YTT", |
| 179 |
"S", |
| 180 |
"B", |
| 181 |
"C4", |
| 182 |
"T10", |
| 183 |
"T20", |
| 184 |
"SIM", |
| 185 |
"TID", |
| 186 |
"ARG", |
| 187 |
"DTZ", |
| 188 |
"ERA", |
| 189 |
"UP", |
| 190 |
"PLC", |
| 191 |
"PLE", |
| 192 |
"PLR", |
| 193 |
"PLW", |
| 194 |
"PIE", |
| 195 |
"RUF", |
| 196 |
] |
| 197 |
|
| 198 |
[tool.coverage.run] |
| 199 |
branch = true |
| 200 |
|
| 201 |
[tool.coverage.report] |
| 202 |
fail_under = 97 |
| 203 |
show_missing = true |