Skip to content

Commit bea550a

Browse files
Fixes update intrinsics action (#362)
ci: fix broken Markdown intrinsics workflow Fixes #358 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1d5b39b commit bea550a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/update-intrinsics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
2323
- name: Update Markdown intrinsics
2424
run: |
25-
python3 -m fortls.intrinsics
25+
python3 -m fortls.parsers.internal.intrinsics
2626
2727
- name: Create Pull Request
2828
uses: peter-evans/create-pull-request@v6

fortls/parsers/internal/intrinsics.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import glob
44
import json
55
import os
6-
import pathlib
6+
from pathlib import Path
77

88
from fortls.helper_functions import fortran_md, get_placeholders, map_keywords
99

@@ -271,13 +271,15 @@ def update_m_intrinsics():
271271
for f in sorted(files):
272272
key = f.replace("M_intrinsics/md/", "")
273273
key = key.replace(".md", "").upper() # remove md extension
274-
val = pathlib.Path(f).read_text()
274+
val = Path(f).read_text()
275275
# remove manpage tag
276276
val = val.replace(f"**{key.lower()}**(3)", f"**{key.lower()}**")
277277
val = val.replace(f"**{key.upper()}**(3)", f"**{key.upper()}**")
278278
markdown_intrinsics[key] = val
279279

280-
with open("fortls/intrinsic.procedures.markdown.json", "w") as f:
280+
with open(
281+
Path(__file__).parent / "intrinsic.procedures.markdown.json", "w"
282+
) as f:
281283
json.dump(markdown_intrinsics, f, indent=2)
282284
f.write("\n") # add newline at end of file
283285
except Exception as e:

0 commit comments

Comments
 (0)