Skip to content

Commit

Permalink
Fixes update intrinsics action (#362)
Browse files Browse the repository at this point in the history
ci: fix broken Markdown intrinsics workflow

Fixes #358
---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
azzamh15 and pre-commit-ci[bot] committed Mar 19, 2024
1 parent 1d5b39b commit bea550a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-intrinsics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Update Markdown intrinsics
run: |
python3 -m fortls.intrinsics
python3 -m fortls.parsers.internal.intrinsics
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand Down
8 changes: 5 additions & 3 deletions fortls/parsers/internal/intrinsics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import glob
import json
import os
import pathlib
from pathlib import Path

from fortls.helper_functions import fortran_md, get_placeholders, map_keywords

Expand Down Expand Up @@ -271,13 +271,15 @@ def update_m_intrinsics():
for f in sorted(files):
key = f.replace("M_intrinsics/md/", "")
key = key.replace(".md", "").upper() # remove md extension
val = pathlib.Path(f).read_text()
val = Path(f).read_text()
# remove manpage tag
val = val.replace(f"**{key.lower()}**(3)", f"**{key.lower()}**")
val = val.replace(f"**{key.upper()}**(3)", f"**{key.upper()}**")
markdown_intrinsics[key] = val

with open("fortls/intrinsic.procedures.markdown.json", "w") as f:
with open(
Path(__file__).parent / "intrinsic.procedures.markdown.json", "w"
) as f:
json.dump(markdown_intrinsics, f, indent=2)
f.write("\n") # add newline at end of file
except Exception as e:
Expand Down

0 comments on commit bea550a

Please sign in to comment.