-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if any news fragments have invalid filenames #622
Conversation
a4f1740
to
2ec1c4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_filenames
not setbuild_ignore_filenames
is set to empty listbuild_ignore_filenames
is 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`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the changes.
They look good.
I have to still review the automated tests... but the other part looks good.
@@ -101,12 +101,14 @@ def __main( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 check
will now fail if any news fragments have invalid filenames. You can specify filenames to ignore in the news fragments directory with the newignore
configuration option.towncrier build
will not fail on invalid filenames unlessignore
is set (can be an empty list).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you think it's best
we can leave it as it is. no problem.
…tically ignored filenames
5bba4eb
to
26c60ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Many thanks for the changes.
@@ -101,12 +101,14 @@ def __main( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 check
will now fail if any news fragments have invalid filenames.Added a new configuration option called
build_ignore_filenames
that allows you to specify a list of filenames that should be ignored. If this is set,towncrier build
will also fail if any filenames are invalid, except for those in the list.Added a
--strict
option totowncrier build
to enable this behaviour for whenbuild_ignore_filenames
has 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.rst
is still up-to-date.docs/cli.rst
reflects those changes.docs/configuration.rst
reflects those changes. (Not applicable)