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

🩹 Fix config file discovery #255

Merged
merged 5 commits into from
Aug 17, 2022
Merged

🩹 Fix config file discovery #255

merged 5 commits into from
Aug 17, 2022

Conversation

s-weigand
Copy link
Owner

Besides "flake8" being hardcoded in flake8.options.config so is the config file name ".flake8" which needs to be replaces with ".flake8_nb" to prevent a regression where ".flake8_nb is ignored.
The other problem with the discovery of config files was that the config discovery happens in Application.initialize which means that the runtime module replacement needs to happen before this and the config module also needs to be replaced inside of flake8.main.application.

closes #254

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 17, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.25%.

Quality metrics Before After Change
Complexity 4.12 ⭐ 3.79 ⭐ -0.33 👍
Method Length 94.05 🙂 98.14 🙂 4.09 👎
Working memory 5.52 ⭐ 5.66 ⭐ 0.14 👎
Quality 71.10% 🙂 70.85% 🙂 -0.25% 👎
Other metrics Before After Change
Lines 556 595 39
Changed files Quality Before Quality After Quality Change
flake8_nb/flake8_integration/cli.py 69.81% 🙂 69.96% 🙂 0.15% 👍
tests/test__main__.py 73.08% 🙂 71.96% 🙂 -1.12% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
flake8_nb/flake8_integration/cli.py Flake8NbApplication.parse_configuration_and_cli 12 🙂 205 ⛔ 9 🙂 48.59% 😞 Try splitting into smaller methods
flake8_nb/flake8_integration/cli.py get_notebooks_from_args 12 🙂 142 😞 53.82% 🙂 Try splitting into smaller methods
flake8_nb/flake8_integration/cli.py Flake8NbApplication.set_flake8_option 9 🙂 97 🙂 10 😞 60.63% 🙂 Extract out complex expressions
tests/test__main__.py test_run_main 3 ⭐ 189 😞 7 🙂 62.90% 🙂 Try splitting into smaller methods
tests/test__main__.py test_syscall 2 ⭐ 180 😞 7 🙂 64.65% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch s-weigand/flake8-nb/fix-config-discovery

@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #255 (f0bef52) into main (4bc29af) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #255   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          429       431    +2     
  Branches        74        74           
=========================================
+ Hits           429       431    +2     
Impacted Files Coverage Δ
flake8_nb/flake8_integration/cli.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@s-weigand s-weigand merged commit e26b9a4 into main Aug 17, 2022
@s-weigand s-weigand deleted the fix-config-discovery branch August 17, 2022 17:49
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.

[BUG] Excluded directory is checked.
1 participant