-
Notifications
You must be signed in to change notification settings - Fork 123
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
Allow towncrier
to traverse back up directories looking for the configuration file
#601
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e9840b3
Traverse filesystem for config
SmileyChris 3d32f9d
Add traversal test
SmileyChris f4230f5
Add news fragment
SmileyChris 99a253e
Update newsfragment
SmileyChris 80be015
Add docstring to load_config_from_options and some explanatory commen…
SmileyChris 7321151
Simplify branching in load_config_from_options
SmileyChris 9c42c69
Docstring nitpick
SmileyChris f837804
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] dc0b8a1
Merge branch 'trunk' into traverse-config
SmileyChris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Running ``towncrier`` will now traverse back up directories looking for the configuration file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think that this should be private.
I know that this is from
_settings.load
, but I think that we should make it explicit that we don't want to expose this as a public API.Also, there are a lot of branches here,
so I think that it would help to add an explicit comment for this branch.
With the missing docstring for the
load_config_from_options
it's a bit hard to understand the purpose of this function.Can we have something like this.
It lools like a bit of duplication between
traverse_for_config
and these following linesmaybe have something like this
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 don't think there's any assumption that non underscored methods become automatically part of a public API is there? If people want to shoot themselves in the foot, let em 🤠
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've added a docstring and some comments to explain the different branches (I don't like the complexity of the towncrier's loading, but I'm not going to rewrite it just for this addition)
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.
Actually, I see what you're getting at with the branching logic now. I've simplified it (and added another test).