Skip to content

Monkey patch to replace read_toml_opts entirely. Resolves #4 #16

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 2 commits into from
Jan 29, 2025

Conversation

csala
Copy link
Owner

@csala csala commented Jan 29, 2025

Resolves #4

This PR exploits the fact that plugin modules are imported along with the rest of the mdformat code to monkey patch the mdformat._conf.read_toml_opts and replace it with an equivalent one that loads the options from the pyproject.toml file instead of the .mdformat.toml one.

This change allows setting in the pyproject.toml file all the options that can be set in the .mdformat.toml one, including the internal mdformat options lile exclude, and not just the ones that affect the markdown_it object like was happening before.

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.50%. Comparing base (9f1d852) to head (0e96e78).
Report is 3 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   92.00%   92.50%   +0.50%     
==========================================
  Files           2        2              
  Lines          50       40      -10     
==========================================
- Hits           46       37       -9     
+ Misses          4        3       -1     

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

@csala csala merged commit b476b07 into master Jan 29, 2025
13 checks passed
@csala csala deleted the gh-4-Some-options-in-pyproject.toml-are-ignored branch January 29, 2025 06:04
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.

Some options in pyproject.toml are ignored
2 participants