Skip to content
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

Add docs for CLI orphan fragments #589

Merged
merged 4 commits into from
Apr 26, 2024

Conversation

SmileyChris
Copy link
Contributor

towncrier create +.feature.rst wasn't documented.

@SmileyChris SmileyChris requested a review from a team as a code owner April 24, 2024 00:15
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is much better. Much appreciated :)

I was always confused by the orphan thing...as I don't use or need it

I think is best to also mention this behaviour in the create docstring

def _main(
ctx: click.Context,
directory: str | None,
config: str | None,
filename: str,
edit: bool,
content: str,
) -> None:
"""
Create a new news fragment.
Create a new news fragment called FILENAME or pass the full path for a file.
Towncrier has a few standard types of news fragments, signified by the file extension.
\b
These are:
* .feature - a new feature
* .bugfix - a bug fix
* .doc - a documentation improvement,
* .removal - a deprecation or removal of public API,
* .misc - a ticket has been closed, but it is not of interest to users.
"""
__main(ctx, directory, config, filename, edit, content)

In this way, the info is found in towncrier create --help

The idea is that in the future we can just run some helper utility for click and it will automatically generate the .RST documentation for the CLI.

I think is best to keep as much info as possible into the --help part.

For the --help docstring , we can keep the info brief,
Just mention that you can use + as the ticket number and towncrier will auto-generate

More info and examples, can be found in the RST version.

Thanks again

docs/cli.rst Outdated Show resolved Hide resolved
@adiroiban adiroiban merged commit 2908a62 into twisted:trunk Apr 26, 2024
15 checks passed
@adiroiban
Copy link
Member

Thanks Chris. I have merged this. I added you to the list of maintainer, so if the future you should be able to merge a PR once it is approved.

Just make sure that any change is reviewed and approved before a merge.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants