Skip to content

Commit ed9f354

Browse files
committed
initial commit
Signed-off-by: Stephen L Arnold <[email protected]>
0 parents  commit ed9f354

36 files changed

+3078
-0
lines changed

.gitchangelog.rc

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,312 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
##
3+
## Message Format
4+
##
5+
## ACTION: [AUDIENCE:] COMMIT_MSG [!TAG ...]
6+
##
7+
## Description
8+
##
9+
## ACTION is one of 'chg', 'fix', 'new'
10+
##
11+
## Is WHAT the change is about.
12+
##
13+
## 'chg' is for refactor, small improvement, cosmetic changes...
14+
## 'fix' is for bug fixes
15+
## 'new' is for new features, big improvement
16+
##
17+
## AUDIENCE is optional and one of 'dev', 'usr', 'pkg', 'test', 'doc'
18+
##
19+
## Is WHO is concerned by the change.
20+
##
21+
## 'dev' is for developpers (API changes, refactors...)
22+
## 'usr' is for final users (UI changes)
23+
## 'pkg' is for packagers (packaging changes)
24+
## 'test' is for testers (test only related changes)
25+
## 'doc' is for doc guys (doc only changes)
26+
##
27+
## COMMIT_MSG is ... well ... the commit message itself.
28+
##
29+
## TAGs are additionnal adjective as 'refactor' 'minor' 'cosmetic'
30+
##
31+
## They are preceded with a '!' or a '@' (prefer the former, as the
32+
## latter is wrongly interpreted in github.) Commonly used tags are:
33+
##
34+
## 'refactor' is obviously for refactoring code only
35+
## 'minor' is for a very meaningless change (a typo, adding a comment)
36+
## 'cosmetic' is for cosmetic driven change (re-indentation, 80-col...)
37+
## 'wip' is for partial functionality but complete subfunctionality.
38+
##
39+
## Example:
40+
##
41+
## new: usr: support of bazaar implemented
42+
## chg: re-indentend some lines !cosmetic
43+
## new: dev: updated code to be compatible with last version of killer lib.
44+
## fix: pkg: updated year of licence coverage.
45+
## new: test: added a bunch of test around user usability of feature X.
46+
## fix: typo in spelling my name in comment. !minor
47+
##
48+
## Please note that multi-line commit message are supported, and only the
49+
## first line will be considered as the "summary" of the commit message. So
50+
## tags, and other rules only applies to the summary. The body of the commit
51+
## message will be displayed in the changelog without reformatting.
52+
53+
54+
##
55+
## ``ignore_regexps`` is a line of regexps
56+
##
57+
## Any commit having its full commit message matching any regexp listed here
58+
## will be ignored and won't be reported in the changelog.
59+
##
60+
#ignore_regexps = []
61+
ignore_regexps = [
62+
r'^([cC]i)\s*:',
63+
r'dependabot',
64+
r'@minor', r'!minor',
65+
r'@cosmetic', r'!cosmetic',
66+
r'@refactor', r'!refactor',
67+
r'@wip', r'!wip',
68+
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
69+
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
70+
r'^$', ## ignore commits with empty messages
71+
]
72+
73+
74+
## ``section_regexps`` is a list of 2-tuples associating a string label and a
75+
## list of regexp
76+
##
77+
## Commit messages will be classified in sections thanks to this. Section
78+
## titles are the label, and a commit is classified under this section if any
79+
## of the regexps associated is matching.
80+
##
81+
## Please note that ``section_regexps`` will only classify commits and won't
82+
## make any changes to the contents. So you'll probably want to go check
83+
## ``subject_process`` (or ``body_process``) to do some changes to the subject,
84+
## whenever you are tweaking this variable.
85+
##
86+
section_regexps = [
87+
('New', [
88+
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
89+
]),
90+
('Features', [
91+
r'^([nN]ew|[fF]eat)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
92+
]),
93+
('Changes', [
94+
r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
95+
]),
96+
('Fixes', [
97+
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
98+
]),
99+
100+
('Other', None ## Match all lines
101+
),
102+
]
103+
104+
105+
## ``body_process`` is a callable
106+
##
107+
## This callable will be given the original body and result will
108+
## be used in the changelog.
109+
##
110+
## Available constructs are:
111+
##
112+
## - any python callable that take one txt argument and return txt argument.
113+
##
114+
## - ReSub(pattern, replacement): will apply regexp substitution.
115+
##
116+
## - Indent(chars=" "): will indent the text with the prefix
117+
## Please remember that template engines gets also to modify the text and
118+
## will usually indent themselves the text if needed.
119+
##
120+
## - Wrap(regexp=r"\n\n"): re-wrap text in separate paragraph to fill 80-Columns
121+
##
122+
## - noop: do nothing
123+
##
124+
## - ucfirst: ensure the first letter is uppercase.
125+
## (usually used in the ``subject_process`` pipeline)
126+
##
127+
## - final_dot: ensure text finishes with a dot
128+
## (usually used in the ``subject_process`` pipeline)
129+
##
130+
## - strip: remove any spaces before or after the content of the string
131+
##
132+
## - SetIfEmpty(msg="No commit message."): will set the text to
133+
## whatever given ``msg`` if the current text is empty.
134+
##
135+
## Additionally, you can `pipe` the provided filters, for instance:
136+
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ")
137+
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)')
138+
#body_process = noop
139+
# yes, this is a bit ugly...
140+
# change '------' and '======' into mixed '-======-'
141+
# to avoid having them look like rst sections
142+
# (but also avoid turning 'A == B' into 'A =- B')
143+
body_process = (ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') |
144+
ReSub(r'---', r'===') |
145+
ReSub(r'=--', r'===') |
146+
ReSub(r'(^|\s)===', r'\1-==') |
147+
ReSub(r'===($|\s)', r'==-\1') |
148+
ReSub(r'-==($|\s)', r'-=-\1') |
149+
strip)
150+
#body_process = lambda text: ""
151+
#body_process = ReSub(r'.*', '')
152+
153+
154+
## ``subject_process`` is a callable
155+
##
156+
## This callable will be given the original subject and result will
157+
## be used in the changelog.
158+
##
159+
## Available constructs are those listed in ``body_process`` doc.
160+
subject_process = (strip |
161+
ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
162+
SetIfEmpty("No commit message.") | ucfirst | final_dot)
163+
164+
165+
## ``tag_filter_regexp`` is a regexp
166+
##
167+
## Tags that will be used for the changelog must match this regexp.
168+
##
169+
tag_filter_regexp = r'^v?[0-9]+\.[0-9]+(\.[0-9]+)?$'
170+
#tag_filter_regexp = r"^.*$"
171+
172+
## ``unreleased_version_label`` is a string or a callable that outputs a string
173+
##
174+
## This label will be used as the changelog Title of the last set of changes
175+
## between last valid tag and HEAD if any.
176+
# custom template (.tpl file below) overrides this setting
177+
#unreleased_version_label = lambda: swrap(
178+
# ["git", "describe", "--tags"],
179+
# shell=False,
180+
#)
181+
#unreleased_version_label = "(unreleased)"
182+
import setuptools_scm
183+
unreleased_version_label = setuptools_scm.get_version()
184+
185+
## ``output_engine`` is a callable
186+
##
187+
## This will change the output format of the generated changelog file
188+
##
189+
## Available choices are:
190+
##
191+
## - rest_py
192+
##
193+
## Legacy pure python engine, outputs ReSTructured text.
194+
## This is the default.
195+
##
196+
## - mustache(<template_name>)
197+
##
198+
## Template name could be any of the available templates in
199+
## ``templates/mustache/*.tpl``.
200+
## Requires python package ``pystache``.
201+
## Examples:
202+
## - mustache("markdown")
203+
## - mustache("restructuredtext")
204+
##
205+
## - makotemplate(<template_name>)
206+
##
207+
## Template name could be any of the available templates in
208+
## ``templates/mako/*.tpl``.
209+
## Requires python package ``mako``.
210+
## Examples:
211+
## - makotemplate("restructuredtext")
212+
##
213+
output_engine = rest_py
214+
#output_engine = mustache("restructuredtext")
215+
#output_engine = mustache("markdown")
216+
#output_engine = makotemplate("restructuredtext")
217+
218+
219+
## ``include_merge`` is a boolean
220+
##
221+
## This option tells git-log whether to include merge commits in the log.
222+
## The default is to include them.
223+
include_merge = True
224+
225+
226+
## ``log_encoding`` is a string identifier
227+
##
228+
## This option tells gitchangelog what encoding is outputed by ``git log``.
229+
## The default is to be clever about it: it checks ``git config`` for
230+
## ``i18n.logOutputEncoding``, and if not found will default to git's own
231+
## default: ``utf-8``.
232+
#log_encoding = 'utf-8'
233+
234+
235+
## ``publish`` is a callable
236+
##
237+
## Sets what ``gitchangelog`` should do with the output generated by
238+
## the output engine. ``publish`` is a callable taking one argument
239+
## that is an interator on lines from the output engine.
240+
##
241+
## Some helper callable are provided:
242+
##
243+
## Available choices are:
244+
##
245+
## - stdout
246+
##
247+
## Outputs directly to standard output
248+
## (This is the default)
249+
##
250+
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start(), flags)
251+
##
252+
## Creates a callable that will parse given file for the given
253+
## regex pattern and will insert the output in the file.
254+
## ``idx`` is a callable that receive the matching object and
255+
## must return a integer index point where to insert the
256+
## the output in the file. Default is to return the position of
257+
## the start of the matched string.
258+
##
259+
## - FileRegexSubst(file, pattern, replace, flags)
260+
##
261+
## Apply a replace inplace in the given file. Your regex pattern must
262+
## take care of everything and might be more complex. Check the README
263+
## for a complete copy-pastable example.
264+
##
265+
# publish = FileInsertIntoFirstRegexMatch(
266+
# "CHANGELOG.rst",
267+
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
268+
# idx=lambda m: m.start(1)
269+
# )
270+
271+
#publish = stdout
272+
273+
274+
## ``revs`` is a list of callable or a list of string
275+
##
276+
## callable will be called to resolve as strings and allow dynamical
277+
## computation of these. The result will be used as revisions for
278+
## gitchangelog (as if directly stated on the command line). This allows
279+
## to filter exaclty which commits will be read by gitchangelog.
280+
##
281+
## To get a full documentation on the format of these strings, please
282+
## refer to the ``git rev-list`` arguments. There are many examples.
283+
##
284+
## Using callables is especially useful, for instance, if you
285+
## are using gitchangelog to generate incrementally your changelog.
286+
##
287+
## Some helpers are provided, you can use them::
288+
##
289+
## - FileFirstRegexMatch(file, pattern): will return a callable that will
290+
## return the first string match for the given pattern in the given file.
291+
## If you use named sub-patterns in your regex pattern, it'll output only
292+
## the string matching the regex pattern named "rev".
293+
##
294+
## - Caret(rev): will return the rev prefixed by a "^", which is a
295+
## way to remove the given revision and all its ancestor.
296+
##
297+
## Please note that if you provide a rev-list on the command line, it'll
298+
## replace this value (which will then be ignored).
299+
##
300+
## If empty, then ``gitchangelog`` will act as it had to generate a full
301+
## changelog.
302+
##
303+
## The default is to use all commits to make the changelog.
304+
#revs = ["^1.0.3", ]
305+
#revs = [
306+
# Caret(
307+
# FileFirstRegexMatch(
308+
# "CHANGELOG.rst",
309+
# r"(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")),
310+
# "HEAD"
311+
#]
312+
revs = []

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
commit-message:
9+
prefix: "ci:"
10+
labels: ["actions"]
11+
# only needed for non-default branch
12+
#target-branch: "develop"
13+
groups:
14+
all-actions:
15+
patterns: [ "*" ]
16+
17+
- package-ecosystem: "pip"
18+
directory: "/"
19+
schedule:
20+
interval: "weekly"
21+
commit-message:
22+
prefix: "ci:"
23+
labels: ["dependencies"]
24+
allow:
25+
- dependency-name: "all"
26+
groups:
27+
python-packages:
28+
patterns: [ "*" ]

.github/workflows/autobot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Dependabot automation
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
dependabot:
15+
env:
16+
PR_URL: ${{ github.event.pull_request.html_url }}
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Fetch Dependabot metadata
22+
id: metadata
23+
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
24+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
25+
with:
26+
github-token: "${{ secrets.GITHUB_TOKEN }}"
27+
28+
- name: Enable auto-approve for Dependabot PRs
29+
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
30+
run: gh pr review --approve "${PR_URL}"
31+
32+
- name: Enable auto-approve for Dependabot PRs
33+
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
34+
run: gh pr merge --squash --auto "${PR_URL}" || gh pr merge --merge --auto "${PR_URL}" || gh pr merge --rebase --auto "${PR_URL}"

0 commit comments

Comments
 (0)