Skip to content

feat: override keys and dot-prop#1440

Merged
Nytelife26 merged 19 commits intoamperser:mainfrom
drainpixie:feat/disable-check
Oct 6, 2025
Merged

feat: override keys and dot-prop#1440
Nytelife26 merged 19 commits intoamperser:mainfrom
drainpixie:feat/disable-check

Conversation

@drainpixie
Copy link
Copy Markdown
Collaborator

@drainpixie drainpixie commented Sep 29, 2025

Relevant issues

#1375

Brief

Make it possible to disable checks without too much repetition, e.g. instead of writing

{
	"typography.symbols.ellipsis": false,
	"typography.symbols.curly_quotes": false
}

You're now able to

{
	"typography.symbols": {
		"ellipsis": false,
		"curly_quotes": false
	}
}

And support overriding keys like such:

{
    "typography": true,
    "typography.symbols": false,
    "typography.symbols.curly_quotes": true,
    "typography.punctuation.hyperbole": false
}

Changes

  • Fix typings in config.py
  • Implement configuration flattening for dot-propping
  • Implement overriding in get_all_enabled
  • Test overriding behaviour

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.19%. Comparing base (7bfb8f1) to head (e93dcad).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1440      +/-   ##
==========================================
- Coverage   94.28%   94.19%   -0.09%     
==========================================
  Files          99       99              
  Lines         805      810       +5     
==========================================
+ Hits          759      763       +4     
- Misses         46       47       +1     
Flag Coverage Δ
macos-latest 93.45% <100.00%> (-0.09%) ⬇️
py3.10 94.19% <100.00%> (-0.09%) ⬇️
py3.11 94.19% <100.00%> (-0.09%) ⬇️
py3.12 94.19% <100.00%> (-0.09%) ⬇️
py3.13 93.45% <100.00%> (-0.09%) ⬇️
py3.14 93.45% <100.00%> (-0.09%) ⬇️
ubuntu-latest 93.45% <100.00%> (-0.09%) ⬇️
windows-latest 94.19% <100.00%> (-0.09%) ⬇️

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.

@drainpixie drainpixie changed the title feat: disable checks feat: dot-prop config Oct 1, 2025
@drainpixie drainpixie marked this pull request as ready for review October 1, 2025 11:08
@drainpixie drainpixie changed the title feat: dot-prop config feat: override keys and dot-prop Oct 2, 2025
Nytelife26 added a commit that referenced this pull request Oct 3, 2025
As @drainpixie noticed in #1440, checking segment sequences is
equivalent to asking if the raw path starts with the partial key
followed by the delimiter. This greatly improves the performance of
matches_partial in the fallback case (3x on my system).

Co-authored-by: drainpixie <121581793+drainpixie@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@Nytelife26 Nytelife26 left a comment

Choose a reason for hiding this comment

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

I love the overall simplicity of your solution here. Good work.

Copy link
Copy Markdown
Contributor

@Nytelife26 Nytelife26 left a comment

Choose a reason for hiding this comment

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

Minor documentation changes, and then we're good to go.

drainpixie and others added 4 commits October 3, 2025 20:34
Co-authored-by: Tyler J Russell <xtylerjrx@gmail.com>
Signed-off-by: drainpixie <121581793+drainpixie@users.noreply.github.com>
Co-authored-by: Tyler J Russell <xtylerjrx@gmail.com>
Signed-off-by: drainpixie <121581793+drainpixie@users.noreply.github.com>
Co-authored-by: Tyler J Russell <xtylerjrx@gmail.com>
Signed-off-by: drainpixie <121581793+drainpixie@users.noreply.github.com>
@Nytelife26 Nytelife26 merged commit ddebe9f into amperser:main Oct 6, 2025
18 checks passed
@Nytelife26 Nytelife26 mentioned this pull request Oct 6, 2025
10 tasks
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.

2 participants