Commit Graph

23 Commits

Author SHA1 Message Date
Hynek Schlawack 9a58911ea7 Add black & isort to pre-commit
Use the default 88 columns from Black while allowing for 99 columns for longer (doc)strings.
2022-04-11 15:43:12 +02:00
Hynek Schlawack de70b1db1d Bootstrap pre-commit.ci
This adds no new code linters or formatters, but ensures that flake8 (and some
minor others) are run using pre-commit.ci on each PR.

That's very fast and fixes problems in-PR, not requiring review turnarounds.

Additionally we get more stable linters via version pinning for free. The
updates are capped to once per month to prevent unnecessary churn.

Since flake8 now runs over the whole code base, I've added a few noqas where it
made sense.
2022-04-11 07:13:40 +02:00
Adi Roiban 425325f51a
Update test to update the coverage. 2022-04-10 16:36:14 +01:00
Hynek Schlawack efc9e6ffdd Remove unneeded compat code
Courtesy of pyupgrade.
2022-04-09 09:51:11 +02:00
Kyle Altendorf ab08d55885 lots of changes and adjustments 2020-12-21 13:56:10 -05:00
Kyle Altendorf 7a49dc663a Merge branch 'master' into draft_and_not_more_similar 2020-12-20 16:44:19 -05:00
Kyle Altendorf 82a092b2ca
Correct to start_string consistently (#301)
* Correct to start_string consistently

* Add test docstring

* add test for coverage and conditional to avoid exception

* Add test docstring

* Update test_build.py

* flake8

* expound on docs

* Update src/towncrier/newsfragments/277.doc.rst
2020-12-20 16:23:17 -05:00
Kyle Altendorf 46c31572a8
Add title_format tests and drop a line (#299)
* Add title_format tests and drop a line

* flake8

* Add 299.misc.rst

* Add test docstrings

* update test

* Update test_build.py

* Update test_build.py

* remove whitespace from a blank line

* Apply suggestions from code review

Co-authored-by: Adi Roiban <adiroiban@gmail.com>

* fixup

* expound case in test docstring

* add brief explanation of title_format outside the example

Co-authored-by: Adi Roiban <adiroiban@gmail.com>
2020-12-20 14:43:07 -05:00
Kyle Altendorf 9ed955f24c - , 2020-12-19 19:32:36 -05:00
Kyle Altendorf 9d41915948
Update test_build.py 2020-12-19 19:27:50 -05:00
Kyle Altendorf b184c4d653 Merge branch 'master' into draft_and_not_more_similar 2020-12-19 17:07:46 -05:00
Kyle Altendorf 96178dc0ff
Raise ConfigError for missing newsfragment directory (#298)
* Treat a missing newsfragment directory as if it is empty

#85

* OSError for py2

* add missing sys import

* Add test docstrings

* Raise a ConfigError when the newsfragment directory is missing

* Update src/towncrier/newsfragments/85.bugfix.rst

Co-authored-by: Adi Roiban <adiroiban@gmail.com>

* reduce unneeded test diff

* remove probably copy/paste error comment

* Update src/towncrier/test/test_build.py

Co-authored-by: Adi Roiban <adiroiban@gmail.com>

Co-authored-by: Adi Roiban <adiroiban@gmail.com>
2020-12-19 14:17:19 -05:00
Kyle Altendorf 87860f39d2
Clean no config exit (#302)
* Correct build subcommand handling of exceptions on exit

* Add 84.bugfix.rst

* flake8

* add test docstrinc

* Update src/towncrier/newsfragments/84.bugfix.rst

Co-authored-by: Adi Roiban <adiroiban@gmail.com>

* Adjust exception handling structure

* back to original change, but simplified

* print_function

Co-authored-by: Adi Roiban <adiroiban@gmail.com>
2020-12-19 11:02:44 -05:00
Kyle Altendorf a30fa9f06e
add test docstring 2020-12-15 22:51:29 -05:00
Kyle Altendorf 137204e7df flake8 2020-12-14 23:00:01 -05:00
Kyle Altendorf a418283f7d Use common code between draft and not for combining top line and rendered 2020-12-14 22:48:57 -05:00
Grzegorz Śliwiński 441ef3f388
Allow for defining arbitrary project version and name in configuratio… (#166)
* Allow for defining arbitrary project version and name in configuration - close #165

    This allows for the towncrier to be seamlessly used in non-python projects

* add tests

* Update src/towncrier/newsfragments/165.feature.rst

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update README.rst

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Use shorter config option names for version and name

* Updated readme

* Update src/towncrier/newsfragments/165.feature.rst

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update README.rst

    Co-authored-by: Kyle Altendorf <sda@fstab.net>

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2020-12-06 22:50:58 -05:00
Amber Brown 3d01a194a6
Factor in #158 and clean up some configuration options (#162)
* ENH: Add no bullet point option

When `all_bullets` is set to false, then fragmets that should be
rendered as bullet points will have include the bullet itself.
In that case, bullets will be sorted to the front (bullets include
"*", "-", and "#." enumeration).
To make indentation of the ticket info easier, a `get_indent(text)`
function is exposed to the jinja template.

* testing and cleanups
2019-09-15 09:11:24 +10:00
Amber Brown 4068ee4a7e
Add single_file option
Split from https://github.com/hawkowl/towncrier/pull/158, contributed by @seberg
2019-09-01 18:33:33 +10:00
Amber H. Brown b5469a5b37 fixes 2019-08-12 03:54:52 +10:00
Amber H. Brown c8e5a0bc4a Merge remote-tracking branch 'origin/master' into add-subcommands 2019-08-12 02:14:09 +10:00
Stephen Finucane 9751f4d890 Add subcommand support
Instead of having a single 'towncrier' command, add 'build' and 'check'
subcommands. The 'click-default-group' extension is used to allow us to
continue running the 'build' command by default, though we should look
at deprecating this in the future.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #144
2019-03-16 18:12:09 +00:00
Stephen Finucane 28ffbc0ba2 Move main command to 'build' module
For now, this simply lets us run the build command in the same way we
run the check command, namely:

    $ python -m towncrier.build

However, it will let us do far more powerful stuff shortly.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-03-16 16:59:41 +00:00