Skip to content

refactor: modernise config #1394

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 10 commits into from
Jun 13, 2025
Merged

Conversation

Nytelife26
Copy link
Member

  • factor configuration functions out of proselint.tools into proselint.config
  • use Path instead of os functions
  • convert default config into an import resource (default.json)
  • update tests to reflect these changes

@Nytelife26 Nytelife26 requested a review from suchow as a code owner June 12, 2025 19:34
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.07%. Comparing base (053295c) to head (cc0d4a2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
proselint/config/__init__.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1394      +/-   ##
==========================================
+ Coverage   91.80%   92.07%   +0.26%     
==========================================
  Files          83       84       +1     
  Lines        1013     1009       -4     
==========================================
- Hits          930      929       -1     
+ Misses         83       80       -3     
Flag Coverage Δ
macos-latest 92.07% <97.87%> (+0.36%) ⬆️
py3.10 92.07% <97.87%> (+0.26%) ⬆️
py3.11 92.07% <97.87%> (+0.26%) ⬆️
py3.12 92.07% <97.87%> (+0.26%) ⬆️
py3.13 92.07% <97.87%> (+0.26%) ⬆️
py3.9 92.16% <97.87%> (+0.26%) ⬆️
ubuntu-latest 92.07% <97.87%> (+0.36%) ⬆️
windows-latest 92.07% <97.87%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Nytelife26
Copy link
Member Author

@drainpixie review ping :)

@Nytelife26 Nytelife26 added type: refactor Issues and PRs related to code cleanup. version: major Issues and PRs with breaking changes belonging to the next major release. status: review-ready PRs that are ready for author review. cat: maintenance Issues and PRs related to the maintenance of a module. labels Jun 12, 2025
Nytelife26 and others added 6 commits June 13, 2025 23:24
Currently, _deepmerge_dicts is fallible when base contains a
non-dictionary entry if overrides contains a dictionary entry of the
same key. This commit updates the test for deepmerge to include that
path.
Fixes a bug where deepmerge was fallible for instances where a
non-dictionary entry existed in base that existed as a dictionary in
overrides. This rewrite also avoids reassignments, as suggested in
review.

Co-authored-by: drainpixie <[email protected]>
This outsources path validation to the CLI (click).

Co-authored-by: drainpixie <[email protected]>
@Nytelife26 Nytelife26 requested a review from drainpixie June 13, 2025 23:32
config_paths = paths.config_paths + ([config_path] if config_path else [])

for path in config_paths:
if path.is_file():
Copy link
Member Author

@Nytelife26 Nytelife26 Jun 13, 2025

Choose a reason for hiding this comment

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

This is technically a re-validation for the case where path = config_path via the CLI, but this only occurs once, and I don't think there's a clean way to avoid that.

@Nytelife26 Nytelife26 merged commit 0e1feba into amperser:main Jun 13, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: maintenance Issues and PRs related to the maintenance of a module. status: review-ready PRs that are ready for author review. type: refactor Issues and PRs related to code cleanup. version: major Issues and PRs with breaking changes belonging to the next major release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants