-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to check for tabs in IDFs
- Loading branch information
1 parent
9d1b750
commit 75ffa2e
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
import io | ||
import json | ||
import os | ||
|
||
|
||
def usage(): | ||
print("""This script verifies that the idf files in the testfiles directory don't have tab characters.""") | ||
|
||
|
||
current_script_dir = os.path.dirname(os.path.realpath(__file__)) | ||
test_files_dir = os.path.join(current_script_dir, '..', '..', 'testfiles') | ||
|
||
for root, dirs, files in os.walk(test_files_dir): | ||
for sfile in files: | ||
if sfile.endswith('.idf') or sfile.endswith('.imf'): | ||
if root == test_files_dir: | ||
relative_path = sfile | ||
else: | ||
folder = os.path.basename(os.path.normpath(root)) | ||
relative_path = os.path.join(folder, sfile) | ||
abs_path = os.path.join(test_files_dir, relative_path) | ||
with io.open(abs_path, 'r', encoding='utf-8', errors='strict') as fd: | ||
for i, line in enumerate(fd): | ||
if '\t' in line: | ||
print(json.dumps({ | ||
'tool': 'check_for_tabs_in_idfs', | ||
'filename': os.path.join('testfiles', relative_path), | ||
'file': os.path.join('testfiles', relative_path), | ||
'line': i, | ||
'messagetype': 'error', | ||
'message': 'Tab character found in IDF, use spaces for indentation' | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75ffa2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoolingTowerPlantComponent (Myoldmopar) - x86_64-MacOS-10.13-clang: OK (2552 of 2553 tests passed, 4 test warnings)
Messages:\n
Failures:\n
integration Test Summary
75ffa2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoolingTowerPlantComponent (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2592 of 2593 tests passed, 4 test warnings)
Messages:\n
Failures:\n
integration Test Summary
75ffa2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoolingTowerPlantComponent (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)
75ffa2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoolingTowerPlantComponent (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: Build Failed
75ffa2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoolingTowerPlantComponent (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1215 of 1215 tests passed, 0 test warnings)
75ffa2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoolingTowerPlantComponent (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (672 of 673 tests passed, 0 test warnings)
Failures:\n
integration Test Summary