Skip to content

Commit

Permalink
Python tabs test
Browse files Browse the repository at this point in the history
-- Enforce Python files are read in UTF8 encoding when checking for tabs.
-- Ignore ._ files.

Signed-off-by: Besart Dollma <[email protected]>
  • Loading branch information
bdollma committed Jan 22, 2021
1 parent 6caab0c commit 49246d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/automation/regression/functional_tests/syntax_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def test_python_tabs(self):
for file in files:
if is_ignored(file, ignores):
continue
if file.endswith('.py'):
if file.endswith('.py') and not file.startswith("._"):
# python files but no ._ python files
fullpath = os.path.join(path, file)
with open(fullpath) as f:
with open(fullpath, encoding="utf-8") as f:
if '\t' in f.read():
files_with_tabs.append(fullpath)

Expand Down

0 comments on commit 49246d2

Please sign in to comment.