-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat: implement project-wide proselintrc #1173
feat: implement project-wide proselintrc #1173
Conversation
Make the option loading logic more easy to follow: * Centralize all paths looked for in the function by removing the fallback argument. * Cleary read one set of system options and one set of user options and then merge these two sets. * Split out dict merging to new function.
This makes proselint read a .proselintrc file in the current working directory if such a file exists. This file will take precedence over the users configuration but not over a file provided with the --config option.
Thank you for the pull request! I'll triage & review now. |
Codecov Report
@@ Coverage Diff @@
## main #1173 +/- ##
==========================================
+ Coverage 90.19% 94.71% +4.51%
==========================================
Files 83 83
Lines 1203 1210 +7
==========================================
+ Hits 1085 1146 +61
+ Misses 118 64 -54
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@carlsmedstad can you fix the coverage issues by adjusting the relevant unit tests for your changes? |
4a46139
to
66c372c
Compare
I extended one test., hopefully this increases the coverage enough. I'm not sure how to run the codecov job locally. |
@Nytelife26 We’re getting build failures here and in some other PRs for reasons unrelated to the PR itself — Codecov is failing to upload results. |
I noticed this in another pull request. I am not entirely sure if Codecov was down briefly or not, but I'll try rerunning now a few hours later to see if it has been resolved yet. |
You cannot, unfortunately. The best way to approach this is to check within Codecov's UI for the uncovered lines and add testing for them. It appears that for this PR most of the coverage loss stems from
I will adjust the Codecov settings to set a threshold for coverage loss until then. |
tests/test_config_flag.py
Outdated
"non_existing_file"], | ||
stderr=subprocess.PIPE, encoding='utf-8') | ||
assert output.returncode == 2 | ||
assert 'FileNotFoundError' in output.stderr |
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.
It appears that for this PR most of the coverage loss stems from proselint/command_line.py.
To resolve the coverage issues, you need to:
- Add testing that triggers the sys.exit(2) statement
- Add testing for if the configuration file is not a file
I will adjust the Codecov settings to set a threshold for coverage loss until then.
That was exactly what I though I did. Either the test is not working, or codecov is not picking this up.
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.
Apologies, I didn't see this until just now. I'll investigate later tonight.
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.
No worries! Feel free to ping me if you need me for anything.
@carlsmedstad As it happens, you were right - there was an issue with the way we were testing it. Python coverage does not pick up cc: @suchow |
Hey again 👋
This PR makes proselint pick up
.proselintrc
file in the current working directory, i.e. project specific config files. Also included some refactoring and error reporting.Resolves #1112.