Browse Source

Use tabs, not spaces.

pull/672/head
Daniel Grunwald 10 years ago
parent
commit
fe3bee36ad
  1. 30
      BuildTools/tidy.py
  2. 2
      appveyor.yml

30
BuildTools/tidy.py

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
import os, sys
def check(filename):
ok = True
with open(filename, 'r') as f:
for i, line in enumerate(f):
if line.startswith(' '):
print('{}:{}: Line starting with spaces. Use tabs for indentation instead!'.format(filename, i+1))
ok = False
return ok
def main():
root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
dirs_to_check = (
os.path.join(root_dir, subdir)
for subdir in ('ICSharpCode.Decompiler', 'ILSpy', 'ILSpy.BamlDecompiler'))
ok = True
for dir in dirs_to_check:
for root, dirs, files in os.walk(dir):
if '\\obj\\' in root:
continue
for filename in files:
if filename.lower().endswith('.cs'):
if not check(os.path.join(root, filename)):
ok = False
print('Tidy check: {}'.format('successful' if ok else 'failed'))
return 0 if ok else 1
if __name__ == '__main__':
sys.exit(main())

2
appveyor.yml

@ -9,3 +9,5 @@ build: @@ -9,3 +9,5 @@ build:
project: ILSpy.sln
parallel: true
verbosity: minimal
after_test:
- python ICSharpCode.AvalonEdit.Tests\tidy.py

Loading…
Cancel
Save