Skip to content

Commit e182218

Browse files
committed
new: dev: add generated changelog, move original, fix setup.cfg
Signed-off-by: Stephen L Arnold <[email protected]>
1 parent cdbef85 commit e182218

File tree

4 files changed

+4408
-297
lines changed

4 files changed

+4408
-297
lines changed

.gitchangelog.rc

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
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'@minor', r'!minor',
63+
r'@cosmetic', r'!cosmetic',
64+
r'@refactor', r'!refactor',
65+
r'@wip', r'!wip',
66+
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
67+
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
68+
r'^$', ## ignore commits with empty messages
69+
]
70+
71+
72+
## ``section_regexps`` is a list of 2-tuples associating a string label and a
73+
## list of regexp
74+
##
75+
## Commit messages will be classified in sections thanks to this. Section
76+
## titles are the label, and a commit is classified under this section if any
77+
## of the regexps associated is matching.
78+
##
79+
## Please note that ``section_regexps`` will only classify commits and won't
80+
## make any changes to the contents. So you'll probably want to go check
81+
## ``subject_process`` (or ``body_process``) to do some changes to the subject,
82+
## whenever you are tweaking this variable.
83+
##
84+
section_regexps = [
85+
('New', [
86+
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
87+
]),
88+
('Features', [
89+
r'^([nN]ew|[fF]eat)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
90+
]),
91+
('Changes', [
92+
r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
93+
]),
94+
('Fixes', [
95+
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
96+
]),
97+
98+
('Other', None ## Match all lines
99+
),
100+
]
101+
102+
103+
## ``body_process`` is a callable
104+
##
105+
## This callable will be given the original body and result will
106+
## be used in the changelog.
107+
##
108+
## Available constructs are:
109+
##
110+
## - any python callable that take one txt argument and return txt argument.
111+
##
112+
## - ReSub(pattern, replacement): will apply regexp substitution.
113+
##
114+
## - Indent(chars=" "): will indent the text with the prefix
115+
## Please remember that template engines gets also to modify the text and
116+
## will usually indent themselves the text if needed.
117+
##
118+
## - Wrap(regexp=r"\n\n"): re-wrap text in separate paragraph to fill 80-Columns
119+
##
120+
## - noop: do nothing
121+
##
122+
## - ucfirst: ensure the first letter is uppercase.
123+
## (usually used in the ``subject_process`` pipeline)
124+
##
125+
## - final_dot: ensure text finishes with a dot
126+
## (usually used in the ``subject_process`` pipeline)
127+
##
128+
## - strip: remove any spaces before or after the content of the string
129+
##
130+
## - SetIfEmpty(msg="No commit message."): will set the text to
131+
## whatever given ``msg`` if the current text is empty.
132+
##
133+
## Additionally, you can `pipe` the provided filters, for instance:
134+
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ")
135+
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)')
136+
#body_process = noop
137+
body_process = ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') | strip
138+
#body_process = lambda text: ""
139+
#body_process = ReSub(r'.*', '')
140+
141+
142+
## ``subject_process`` is a callable
143+
##
144+
## This callable will be given the original subject and result will
145+
## be used in the changelog.
146+
##
147+
## Available constructs are those listed in ``body_process`` doc.
148+
subject_process = (strip |
149+
ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
150+
SetIfEmpty("No commit message.") | ucfirst | final_dot)
151+
152+
153+
## ``tag_filter_regexp`` is a regexp
154+
##
155+
## Tags that will be used for the changelog must match this regexp.
156+
##
157+
tag_filter_regexp = r'^v?[0-9]+\.[0-9]+(\.[0-9]+)?$'
158+
#tag_filter_regexp = r"^.*$"
159+
160+
## ``unreleased_version_label`` is a string or a callable that outputs a string
161+
##
162+
## This label will be used as the changelog Title of the last set of changes
163+
## between last valid tag and HEAD if any.
164+
# custom template (.tpl file below) overrides this setting
165+
#unreleased_version_label = lambda: swrap(
166+
# ["git", "describe", "--tags"],
167+
# shell=False,
168+
#)
169+
unreleased_version_label = "(unreleased)"
170+
171+
172+
## ``output_engine`` is a callable
173+
##
174+
## This will change the output format of the generated changelog file
175+
##
176+
## Available choices are:
177+
##
178+
## - rest_py
179+
##
180+
## Legacy pure python engine, outputs ReSTructured text.
181+
## This is the default.
182+
##
183+
## - mustache(<template_name>)
184+
##
185+
## Template name could be any of the available templates in
186+
## ``templates/mustache/*.tpl``.
187+
## Requires python package ``pystache``.
188+
## Examples:
189+
## - mustache("markdown")
190+
## - mustache("restructuredtext")
191+
##
192+
## - makotemplate(<template_name>)
193+
##
194+
## Template name could be any of the available templates in
195+
## ``templates/mako/*.tpl``.
196+
## Requires python package ``mako``.
197+
## Examples:
198+
## - makotemplate("restructuredtext")
199+
##
200+
#output_engine = rest_py
201+
#output_engine = mustache("restructuredtext")
202+
output_engine = mustache("markdown")
203+
#output_engine = makotemplate("restructuredtext")
204+
205+
206+
## ``include_merge`` is a boolean
207+
##
208+
## This option tells git-log whether to include merge commits in the log.
209+
## The default is to include them.
210+
include_merge = True
211+
212+
213+
## ``log_encoding`` is a string identifier
214+
##
215+
## This option tells gitchangelog what encoding is outputed by ``git log``.
216+
## The default is to be clever about it: it checks ``git config`` for
217+
## ``i18n.logOutputEncoding``, and if not found will default to git's own
218+
## default: ``utf-8``.
219+
#log_encoding = 'utf-8'
220+
221+
222+
## ``publish`` is a callable
223+
##
224+
## Sets what ``gitchangelog`` should do with the output generated by
225+
## the output engine. ``publish`` is a callable taking one argument
226+
## that is an interator on lines from the output engine.
227+
##
228+
## Some helper callable are provided:
229+
##
230+
## Available choices are:
231+
##
232+
## - stdout
233+
##
234+
## Outputs directly to standard output
235+
## (This is the default)
236+
##
237+
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start(), flags)
238+
##
239+
## Creates a callable that will parse given file for the given
240+
## regex pattern and will insert the output in the file.
241+
## ``idx`` is a callable that receive the matching object and
242+
## must return a integer index point where to insert the
243+
## the output in the file. Default is to return the position of
244+
## the start of the matched string.
245+
##
246+
## - FileRegexSubst(file, pattern, replace, flags)
247+
##
248+
## Apply a replace inplace in the given file. Your regex pattern must
249+
## take care of everything and might be more complex. Check the README
250+
## for a complete copy-pastable example.
251+
##
252+
# publish = FileInsertIntoFirstRegexMatch(
253+
# "CHANGELOG.rst",
254+
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
255+
# idx=lambda m: m.start(1)
256+
# )
257+
258+
#publish = stdout
259+
260+
261+
## ``revs`` is a list of callable or a list of string
262+
##
263+
## callable will be called to resolve as strings and allow dynamical
264+
## computation of these. The result will be used as revisions for
265+
## gitchangelog (as if directly stated on the command line). This allows
266+
## to filter exaclty which commits will be read by gitchangelog.
267+
##
268+
## To get a full documentation on the format of these strings, please
269+
## refer to the ``git rev-list`` arguments. There are many examples.
270+
##
271+
## Using callables is especially useful, for instance, if you
272+
## are using gitchangelog to generate incrementally your changelog.
273+
##
274+
## Some helpers are provided, you can use them::
275+
##
276+
## - FileFirstRegexMatch(file, pattern): will return a callable that will
277+
## return the first string match for the given pattern in the given file.
278+
## If you use named sub-patterns in your regex pattern, it'll output only
279+
## the string matching the regex pattern named "rev".
280+
##
281+
## - Caret(rev): will return the rev prefixed by a "^", which is a
282+
## way to remove the given revision and all its ancestor.
283+
##
284+
## Please note that if you provide a rev-list on the command line, it'll
285+
## replace this value (which will then be ignored).
286+
##
287+
## If empty, then ``gitchangelog`` will act as it had to generate a full
288+
## changelog.
289+
##
290+
## The default is to use all commits to make the changelog.
291+
#revs = ["^1.0.3", ]
292+
#revs = [
293+
# Caret(
294+
# FileFirstRegexMatch(
295+
# "CHANGELOG.rst",
296+
# r"(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")),
297+
# "HEAD"
298+
#]
299+
revs = []

0 commit comments

Comments
 (0)