Skip to content

Add new flag to CLI: --config-file #11036

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

Merged
merged 6 commits into from
May 26, 2023

Conversation

chrimaho
Copy link
Contributor

@chrimaho chrimaho commented May 24, 2023

Add new flag to CLI: --config-file

There is already an exiting flag in the CLI for importing a custom config file: -c. This change does not change the behaviour of that flag, but simply adds a new flag to execute the same process: --config-file.

This change is also in-line with other large Python packages which use the same behaviour:

  • MyPy uses the command: --config-file CONFIG_FILE. See here.
  • Black uses the command: --config FILE. See here.

Chris Mahoney and others added 3 commits May 25, 2023 09:23
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Hi @chrimaho, thanks for the contribution!

However please check your Git settings, both main.py and test_config.py have changed entirely.

@RonnyPfannschmidt
Copy link
Member

it seems like the newline convention was changed, wen setting ignore whitespace it gets down to a reasonable diff

please fix the newline convention

chrimaho and others added 3 commits May 26, 2023 07:41

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- `main.py` to commit SHA `310b67b`
- `test_config.py` to commit SHA `407b330`
Signed-off-by: Chris Mahoney <[email protected]>
@chrimaho
Copy link
Contributor Author

chrimaho commented May 25, 2023

Thank you @nicoddemus and @RonnyPfannschmidt.
This should be fixed now. All tests are passing 👍
Please check and let me know if it's all good.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Reminder: we should squash this before merging.

@nicoddemus
Copy link
Member

nicoddemus commented May 25, 2023

(Small tip @chrimaho: you can add "Fix #11036" to your PR description to automatically close the issue when it gets merged: https://github.blog/2013-05-14-closing-issues-via-pull-requests/).

@nicoddemus nicoddemus merged commit 4f3f36c into pytest-dev:main May 26, 2023
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.

Add additional flag CLI flag to the Ini Options: --config-file
3 participants