Skip to content

Commit

Permalink
Fix check-merge-conflict hook false positive in RST (#53)
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
lkubb authored Sep 23, 2024
1 parent b50919a commit 035b990
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/52.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed check-merge-conflict pre-commit hook false positive in RST files with specific Saltext name lengths
7 changes: 6 additions & 1 deletion project/.pre-commit-hooks/make-autodocs.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ def write_module(rst_path, path, use_virtualname=True):
virtualname = "``" + _find_virtualname(path) + "``"
else:
virtualname = make_import_path(path)
header_len = len(virtualname)
# The check-merge-conflict pre-commit hook chokes here:
# https://github.com/pre-commit/pre-commit-hooks/issues/100
if header_len == 7:
header_len += 1
module_contents = f"""\
{virtualname}
{'='*len(virtualname)}
{'='*header_len}

.. automodule:: {make_import_path(path)}
:members:
Expand Down

0 comments on commit 035b990

Please sign in to comment.