Skip to content

Commit

Permalink
Conventions: Add check for portable filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Mar 6, 2020
1 parent 3390b8d commit 0d12301
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/conventions/analyze_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
r"__INTEL_COMPILER|__cplusplus|\$\{.*\}\$|__.*__"
)

portable_filename_re = re.compile(r"^[a-zA-Z0-9._/#~=+-]*$")

BANNER_F = """\
!--------------------------------------------------------------------------------------------------!
! CP2K: A general program to perform molecular dynamics simulations !
Expand Down Expand Up @@ -170,6 +172,9 @@ def validate(cp2k_dir, filelist=None, excluded_dirs=DEFAULT_EXCLUDED_DIRS):
absfn = path.join(root, fn)
shortfn = path.relpath(absfn, cp2k_dir)

if not portable_filename_re.match(fn):
warnings += ["Filename %s not portable" % shortfn]

if not path.exists(absfn):
continue # skip broken symlinks

Expand Down

0 comments on commit 0d12301

Please sign in to comment.