Skip to content

Commit

Permalink
Conventions: Check for tab characters
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Mar 10, 2021
1 parent b0d2eed commit a9dabe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/conventions/analyze_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ def validate(cp2k_dir, filelist=None, excluded_dirs=DEFAULT_EXCLUDED_DIRS):

for fn in files:
fn_ext = fn.rsplit(".", 1)[-1]
if fn_ext in ("template", "instantiate"):
continue

with open(path.join(root, fn), encoding="utf8") as fhandle:
content = fhandle.read()
Expand Down Expand Up @@ -189,6 +187,8 @@ def validate(cp2k_dir, filelist=None, excluded_dirs=DEFAULT_EXCLUDED_DIRS):
continue # skip binary files
if b"\r\n" in content:
warnings += ["Text file %s contains DOS linebreaks" % shortfn]
if b"\t" in content:
warnings += ["Text file %s contains tab character" % shortfn]

return warnings

Expand Down

0 comments on commit a9dabe7

Please sign in to comment.