mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-29 06:35:28 -04:00
Allow non-ASCII characters.
This commit is contained in:
parent
ff9eaa847a
commit
a4c43d8a6b
2 changed files with 1 additions and 17 deletions
|
|
@ -183,22 +183,6 @@ def validate(cp2k_dir, filelist=None, excluded_dirs=DEFAULT_EXCLUDED_DIRS):
|
|||
if b"\r\n" in content:
|
||||
warnings += ["Text file %s contains DOS linebreaks" % shortfn]
|
||||
|
||||
# check for non-ascii chars
|
||||
if re.search(b"[\x80-\xFF]", content):
|
||||
if absfn.endswith(".py"):
|
||||
continue # python files are utf8 encoded by default
|
||||
|
||||
if b"# -*- coding: utf-8 -*-" in content:
|
||||
continue
|
||||
|
||||
for lineno, line in enumerate(content.splitlines()):
|
||||
m = re.search(b"[\x80-\xFF]", line)
|
||||
if m:
|
||||
warnings += [
|
||||
"Found non-ascii char in %s line %d at position %d"
|
||||
% (shortfn, lineno + 1, m.start(0) + 1)
|
||||
]
|
||||
|
||||
return warnings
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
# command line argument passing
|
||||
#
|
||||
###################################################################################
|
||||
export LC_ALL=C
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
# init
|
||||
dir_base=$PWD
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue