From c085220f92782d59478573b1a456e5bbf64657de Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 13 Dec 2015 14:16:20 +0100 Subject: [PATCH] Enforce tabs for indentation. --- .../Properties/WPFAssemblyInfo.cs | 14 +++++----- ICSharpCode.AvalonEdit.Tests/tidy.py | 26 +++++++++++++++++++ .../CodeCompletion/CompletionList.xaml | 2 +- appveyor.yml | 4 ++- 4 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 ICSharpCode.AvalonEdit.Tests/tidy.py diff --git a/ICSharpCode.AvalonEdit.Sample/Properties/WPFAssemblyInfo.cs b/ICSharpCode.AvalonEdit.Sample/Properties/WPFAssemblyInfo.cs index 8b337b96..a83408fc 100644 --- a/ICSharpCode.AvalonEdit.Sample/Properties/WPFAssemblyInfo.cs +++ b/ICSharpCode.AvalonEdit.Sample/Properties/WPFAssemblyInfo.cs @@ -7,7 +7,7 @@ -//In order to begin building localizable applications, set +//In order to begin building localizable applications, set //CultureYouAreCodingWith in your .csproj file //inside a . For example, if you are using US english //in your source files, set the to en-US. Then uncomment @@ -18,10 +18,10 @@ [assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) )] diff --git a/ICSharpCode.AvalonEdit.Tests/tidy.py b/ICSharpCode.AvalonEdit.Tests/tidy.py new file mode 100644 index 00000000..9cc3b37e --- /dev/null +++ b/ICSharpCode.AvalonEdit.Tests/tidy.py @@ -0,0 +1,26 @@ +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(): + dir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) + ok = True + for root, dirs, files in os.walk(dir): + if '\\obj\\' in root: + continue + for filename in files: + if filename.lower().endswith('.cs') or filename.lower().endswith('.xaml'): + 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()) \ No newline at end of file diff --git a/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.xaml b/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.xaml index bf49cc0b..cd680cf8 100644 --- a/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.xaml +++ b/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.xaml @@ -19,7 +19,7 @@ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> diff --git a/appveyor.yml b/appveyor.yml index 9dcff322..e3f8f1d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,4 +6,6 @@ before_build: build: project: ICSharpCode.AvalonEdit.sln parallel: true - verbosity: minimal \ No newline at end of file + verbosity: minimal +after_test: +- python ICSharpCode.AvalonEdit.Tests\tidy.py