-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
231 lines (200 loc) Β· 7.55 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.bandit]
skips = ["B404", "B603"]
# git-cliff ~ https://git-cliff.org/docs/configuration
# with pyproject.toml embedding https://git-cliff.org/docs/integration/python/
[tool.git-cliff.remote.github]
owner = "dupuy"
repo = "reliabot"
# token = ""
[tool.git-cliff.changelog]
# changelog header
header = """
# Changelog\n
This file documents notable changes to Reliabot.\n
It uses the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format,
and follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for
releases.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif -%}
### Details\n
{% for group, commits in commits | group_by(attribute="group") %}
#### {{ group | upper_first }}
{%- for commit in commits %}
- {{ commit.message | upper_first | trim }}\
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%}
{% if commit.github.pr_number %} in \
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \
{%- endif -%}
{% endfor %}
{% endfor %}
{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
## New Contributors\n
{%- endif -%}
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* π§π½βπ» @{{ contributor.username }} made their first contribution β¨
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor %}\n
"""
# template for the changelog footer (release diff reference links)
footer = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% for release in releases -%}
{% if release.version -%}
{% if release.previous.version -%}
[{{ release.version | trim_start_matches(pat="v") }}]: \
{{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
{% endif -%}
{% else -%}
[unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
{% endif -%}
{% endfor %}
<!-- generated by git-cliff on {{ now() | date(format="%Y-%m-%d") }} -->
"""
# remove the leading and trailing whitespace from the templates
trim = true
[tool.git-cliff.git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = true
# regex for preprocessing the commit messages
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^.*: add", group = "Added π" },
{ message = "^.*: support", group = "Added π" },
{ message = "^.*: remove", group = "Removed ποΈ" },
{ message = "^.*: delete", group = "Removed ποΈ" },
{ message = "^test", group = "Fixed π οΈ" },
{ message = "^fix", group = "Fixed π " },
{ message = "^.*: fix", group = "Fixed π " },
{ message = "^.*", group = "Changed π" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# regex for matching git tags
tag_pattern = "v[0-9].*"
# regex for skipping tags
skip_tags = "-(alpha|beta|rc)"
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"
[tool.poetry]
name = "reliabot"
version = "0.2.4"
description = "Maintain GitHub Dependabot configuration."
license = "MIT"
authors = ["Alexander Dupuy <[email protected]>"]
readme = "README.md"
repository = "https://github.com/dupuy/reliabot"
keywords = [
"dependabot",
"dependency-manager",
"github",
"pre-commit-hook",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Plugins",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows :: Windows Vista",
"Operating System :: POSIX",
"Topic :: Software Development :: Version Control :: Git",
"Topic :: System :: Software Distribution",
"Topic :: Utilities",
]
[tool.poetry.dependencies]
python = "^3.8" # 3.8 end-of-life 2024-10
"ruamel.yaml" = "^0.18.6"
pyre2 = { version = "^0.3.6", optional = true }
pyre2-updated = { version = "^0.3.8", optional = true }
[tool.poetry.group.testing]
optional = true
[tool.poetry.group.testing.dependencies]
tox = "^4.23.2"
[tool.poetry.extras]
re2 = ["pyre2"]
re2-wheels = ["pyre2-updated"]
[tool.poetry.scripts]
reliabot = 'reliabot.reliabot:main'
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/dupuy/reliabot/issues"
[tool.ruff]
line-length = 79
# By default, always show source code snippets.
output-format = "full"
# Preview formatting conflicts with python-reorder-imports about blank line
# after initial docstring. Hopefully when it is no longer in preview there
# will be some way to disable it.
#preview = true
# Enumerate all fixed violations.
show-fixes = true
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
# Allow en-dash (U+2013), which could be confused for "-".
allowed-confusables = ["β"]
# Enabling flake8 -builtins (A), -annotations (ANN), -bugbear (B),
# -comprehensions (C4), -pydocstyle (D), -errmsg (EM), -executable (EXE),
# -future-annotations (FA), -boolean-trap (FBT), -implicit-str-concat (ISC),
# -import-conventions (ICN), -pie (PIE), -quotes (Q), -return (RET),
# -bandit (S), -simplify (SIM), -type-checking (TCH), and -2020 (YTT) in
# addition to flynt (FLY) pep8-naming (N), perflint (PERF), pylint (PL*),
# pyupgrade (UP), and the defaults (E4, E7, E9, F).
# Pycodestyle warnings (W) aren't selected since other pre-commits catch them
# (except for too-noisy W505).
# TODO: "ASYNC", "DTZ", "ERA", "G", "INP", "INT", "LOG", "PTH", "SLOT", & "TRIO"
# (if they become relevant). Also maybe "FURB"
select = [
"E4", "E7", "E9", "F", "A", "ANN", "B", "C4", "D", "EM", "EXE", "FA", "FBT",
"ISC", "ICN", "PIE", "Q", "RET", "S", "SIM", "TCH", "YTT",
"FLY", "N", "PERF", "PL", "UP",
"RUF",
]
ignore = [
"ANN101", # missing-type-self
"B028", # no-explicit-stacklevel
"D105", # undocumented-magic-method
"ISC001", # single-line-implicit-string-concatenation # formatter conflict
"PLR091", # too-manu-* # TODO: reduce complexity or disable with comments
"PLR2004", # magic-value-comparison
"S404", # suspicious-subprocess-import
"S603", # subprocess call: check for execution of untrusted input
"UP007", # non-pep604-annotation β Use X | Y for type annotations
]
[tool.ruff.lint.flake8-type-checking]
# Add quotes around type annotations, if doing so would allow
# an import to be moved into a type-checking block.
quote-annotations = true
[tool.ruff.lint.pycodestyle]
max-doc-length = 79
[tool.ruff.lint.pydocstyle]
convention = "pep257"