-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Fix config file search and inclusion in header #2048
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -630,7 +630,7 @@ def select_config_file(src_files: tuple[str, ...]) -> Path | None: | |
# NOTE: input. | ||
working_directory = Path.cwd() | ||
src_files_as_paths = ( | ||
(working_directory / src_file).resolve() for src_file in src_files or (".",) | ||
(working_directory / src_file).resolve() for src_file in src_files + (".",) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain this? Obviously, there's some unspecified side effect in external logic, but I don't get it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This adds the current working directory to the search path for source files as well, as proposed in the linked issue. |
||
) | ||
candidate_dirs = (src if src.is_dir() else src.parent for src in src_files_as_paths) | ||
config_file_path = next( | ||
|
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.
Why is this needed?
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.
See #1902 (comment). Making only
src_files
eager doesn't work though, as it won't pick up the config if not specified, then.