Skip to content

Commit

Permalink
precommit: Touch up DOI check
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Dec 15, 2024
1 parent 3fc5a78 commit d59d53c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/precommit/check_file_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ def get_flags_src() -> str:
@lru_cache(maxsize=None)
def get_bibliography_dois() -> List[str]:
bib = CP2K_DIR.joinpath("src/common/bibliography.F").read_text(encoding="utf8")
matches = re.findall(r'DOI="([^"]+)"', bib, flags=re.IGNORECASE)
return [doi for doi in matches if "/" in doi] # filter invalid DOIs.
matches = re.findall(r'doi="([^"]+)"', bib, flags=re.IGNORECASE)
assert len(matches) > 260 and "10.1016/j.cpc.2004.12.014" in matches
return matches


def check_file(path: pathlib.Path) -> List[str]:
Expand Down

0 comments on commit d59d53c

Please sign in to comment.