mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-16 12:15:31 +00:00
Use ruff to format Python files (#658)
This commit is contained in:
@ -10,18 +10,16 @@ Ref: https://github.com/flutter/flutter/issues/27997
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
dart_files = Path('lib').rglob('*.dart')
|
||||
if __name__ == "__main__":
|
||||
dart_files = Path("lib").rglob("*.dart")
|
||||
|
||||
with open("test/coverage_helper_test.dart", "w") as f:
|
||||
|
||||
f.write("// ignore_for_file: unused_import\n\n")
|
||||
|
||||
skips = [
|
||||
'generated',
|
||||
'l10n',
|
||||
'dsn.dart',
|
||||
"generated",
|
||||
"l10n",
|
||||
"dsn.dart",
|
||||
]
|
||||
|
||||
for path in dart_files:
|
||||
@ -32,15 +30,18 @@ if __name__ == '__main__':
|
||||
|
||||
# Remove leading 'lib\' text
|
||||
path = path[4:]
|
||||
path = path.replace('\\', '/')
|
||||
path = path.replace("\\", "/")
|
||||
f.write(f'import "package:inventree/{path}";\n')
|
||||
|
||||
f.write("\n\n")
|
||||
|
||||
f.write("// DO NOT EDIT THIS FILE - it has been auto-generated by 'find_dart_files.py'\n")
|
||||
f.write("// It has been created to ensure that *all* source file are included in coverage data\n")
|
||||
|
||||
f.write('import "package:test/test.dart";\n\n');
|
||||
f.write(
|
||||
"// DO NOT EDIT THIS FILE - it has been auto-generated by 'find_dart_files.py'\n"
|
||||
)
|
||||
f.write(
|
||||
"// It has been created to ensure that *all* source file are included in coverage data\n"
|
||||
)
|
||||
|
||||
f.write('import "package:test/test.dart";\n\n')
|
||||
f.write("// Do not actually test anything!\n")
|
||||
f.write("void main() {}\n")
|
||||
|
Reference in New Issue
Block a user