Check if any news fragments have invalid filenames#622
Check if any news fragments have invalid filenames#622adiroiban merged 8 commits intotwisted:trunkfrom
Conversation
a4f1740 to
2ec1c4a
Compare
adiroiban
left a comment
There was a problem hiding this comment.
Thanks for working on this.
This needs documentation and tests to be merged.
While reviewing this, my question is.
Why do we ever want to allow towncrier build or towncrier check to succeed if there are in invalid fragments.
I understand that you might want to have other files inside the newsfragment folder (for example the template and a README) but other than that, I think towncrier should fail
Cheers
2ec1c4a to
b85391c
Compare
b85391c to
0993534
Compare
--check-names option to towncrier build|
I think all feedback has been addressed now. Let me know if there is anything else. Maybe a warning if |
adiroiban
left a comment
There was a problem hiding this comment.
Many thanks for the changes.
They look good.
As a general rule, I think that is best to start any new functionality by writing the documentation.
In this way, we can agree on how the feature should behave, before writing more code.
I think that we can have this implemented without the --strict option.
In terms for testing I am expecting 3 main test scenarios:
build_ignore_filenamesnot setbuild_ignore_filenamesis set to empty listbuild_ignore_filenamesis set with some filenames
Thanks again for working on this!
|
I forgot to leave this feedback
That would be nice. We can also have this in a separate PR.
I hope that we don't have to add the It would be nice to have a warinig raised when In a followup release, we can then change the default value of |
- Change `build_ignore_filenames` to `ignore` in config - Remove `--strict` option from `towncrier build`
adiroiban
left a comment
There was a problem hiding this comment.
Many thanks for the changes.
They look good.
I have to still review the automated tests... but the other part looks good.
| click.echo(f"{n}. {change}") | ||
| click.echo("----") | ||
|
|
||
| # This will fail if any fragment files have an invalid name: |
There was a problem hiding this comment.
We can keep it. No problem.
The critical part is to make sure that we have automated tests that will fail is anyone would move this code :)
| @@ -0,0 +1,3 @@ | |||
| ``towncrier check`` will now fail if any news fragments have invalid filenames. | |||
There was a problem hiding this comment.
Not sure how this will ended up in the rendered version.
We should have 2 fragments here.
One for towncrier check
and another one for the ignore configuration option.
But maybe the towncrier check part can be left out.
If build fails, it should be expect for check to also fail.
There was a problem hiding this comment.
I feel like the addition of the config option and the new fail behaviour are intertwined, so I think it makes sense to have them in the same fragment. At least I think the change in behaviour of towncrier check should be clearly signposted.
I could rewrite this to be clearer, how about:
towncrier checkwill now fail if any news fragments have invalid filenames. You can specify filenames to ignore in the news fragments directory with the newignoreconfiguration option.towncrier buildwill not fail on invalid filenames unlessignoreis set (can be an empty list).
There was a problem hiding this comment.
As you think it's best
we can leave it as it is. no problem.
…tically ignored filenames
5bba4eb to
26c60ff
Compare
adiroiban
left a comment
There was a problem hiding this comment.
Looks good. Many thanks for the changes.
| click.echo(f"{n}. {change}") | ||
| click.echo("----") | ||
|
|
||
| # This will fail if any fragment files have an invalid name: |
There was a problem hiding this comment.
Thanks. I didn't had time to check the test coverage... but if say that you have checked it, we can have this merged :)
no problem
| @@ -0,0 +1,3 @@ | |||
| ``towncrier check`` will now fail if any news fragments have invalid filenames. | |||
There was a problem hiding this comment.
As you think it's best
we can leave it as it is. no problem.
|
Thanks for the update. I have enabled auto-merge. I hope this will be merged soon. I plan to do a new release soon... I hope #627 will also be merge soon and then we can have a release. |
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Merge after the inclusion of twisted/towncrier#622 in the next release of towncrier.
Release 24.7.0 made this necessary by scanning for invalid filenames Reference: twisted/towncrier#622
Description
Closes #619
Fixes #426
towncrier checkwill now fail if any news fragments have invalid filenames.Added a new configuration option called
build_ignore_filenamesthat allows you to specify a list of filenames that should be ignored. If this is set,towncrier buildwill also fail if any filenames are invalid, except for those in the list.Added a
--strictoption totowncrier buildto enable this behaviour for whenbuild_ignore_filenameshas not been configured.Checklist
src/towncrier/newsfragments/. Describe yourchange and include important information. Your change will be included in the public release notes.
docs/tutorial.rstis still up-to-date.docs/cli.rstreflects those changes.docs/configuration.rstreflects those changes. (Not applicable)