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

update pre-commit hooks #151

Merged
merged 4 commits into from
Jan 31, 2025
Merged

update pre-commit hooks #151

merged 4 commits into from
Jan 31, 2025

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Jan 31, 2025

Process:

  1. add dummy commit to markdown file (readme.md) to trigger error (on PR CI workflows, pre-commit gets called only on modified files)
  2. call pre-commit autopudate to update hooks to latest version, but revert change for docformatter
  3. call pre-commit run -a to make pre-commit happy
  4. revert dummy commit

This fixes the following CI workflow error (may just occur on merge into main because of modified files check in PR workflows):

 ...
 mdformat.................................................................Failed
- hook id: mdformat
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/bin/mdformat", line 8, in <module>
    sys.exit(run())
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/mdformat/__main__.py", line 8, in run
    exit_code = mdformat._cli.run(sys.argv[1:])
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/mdformat/_cli.py", line 74, in run
    formatted_str = mdformat.text(
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/mdformat/_api.py", line 31, in text
    mdit = build_mdit(
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/mdformat/_util.py", line 40, in build_mdit
    plugin.update_mdit(mdit)
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/mdformat_gfm/_mdformat_plugin.py", line 13, in update_mdit
    mdit.use(gfm_autolink_plugin)
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/markdown_it/main.py", line 229, in use
    plugin(self, *params, **options)
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/mdformat_gfm/_mdit_gfm_autolink_plugin.py", line 12, in gfm_autolink_plugin
    md.inline.ruler.before("linkify", "gfm_autolink", gfm_autolink)
  File "/home/runner/.cache/pre-commit/repox111q2_2/py_env-python3/lib/python3.9/site-packages/markdown_it/ruler.py", line 126, in before
    raise KeyError(f"Parser rule not found: {beforeName}")
KeyError: 'Parser rule not found: linkify'

@ArneBinder ArneBinder added bug Something isn't working ci Continuous Integration labels Jan 31, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.49%. Comparing base (b377744) to head (d6bf842).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #151   +/-   ##
=======================================
  Coverage   95.49%   95.49%           
=======================================
  Files          61       61           
  Lines        5195     5195           
=======================================
  Hits         4961     4961           
  Misses        234      234           

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

@ArneBinder ArneBinder merged commit afcf7d4 into main Jan 31, 2025
2 checks passed
@ArneBinder ArneBinder deleted the update-pre-commit-hooks branch January 31, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci Continuous Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants