Commit Graph

472 Commits

Author SHA1 Message Date
d35b4ed093 code_clean: convert an error to a warning when output can't be created 2022-10-03 11:55:33 +11:00
2ab59df2c9 code_clean: add support for running edits in multiple passes
When an edit cannot be applied because it overlaps one that did,
re-run all edits again until no edits could be applied or the document
reaches a previously visited state (unlikely but possible in theory).
2022-09-26 17:22:17 +10:00
e4062ff43e code_clean: don't run with WITH_UNITY_BUILD/WITH_COMPILER_CCACHE
- Unity build prevents the resulting object files from being extracted.
- Compiler cache adds unnecessary overhead (and cache) for trial edits.
2022-09-26 15:32:33 +10:00
f6db2e6101 Cleanup: remove commented code, formatting tweaks 2022-09-26 15:23:54 +10:00
a288bfa305 code_clean: add use_function_style_cast edit generator
This moves C++ code from C style casts to function call style casts.
2022-09-26 15:20:50 +10:00
146916b413 code_clean: add use_brief_types edit generator
Replace `unsigned int` with `uint` and similar.
2022-09-26 14:44:52 +10:00
6f6e0332e2 code_clean: support removing redundant parenthesis arund function calls
'parenthesis_cleanup' cleanup pass now supports replacing

`(func(a + b))` with `func(a + b)`.

This was useful when cleaning up casts `((int)value)` which then got
converted to `(int(value))` which adds unnecessary braces in most cases.
2022-09-26 14:43:44 +10:00
5836f21ae9 code_clean: don't attempt overlapping edits
Support for running multiple edit-passes is needed to ensure all
overlapping edits can be applied.
2022-09-26 14:15:57 +10:00
61037c23ed code_clean: add parenthesis_cleanup 2022-09-24 00:40:37 +10:00
8db56ac994 check_spelling: exclude addtogroup doxy command 2022-09-24 00:34:44 +10:00
59ebcb75e6 check_spelling_c: update dictionary 2022-09-19 12:50:26 +10:00
8aee73c28f check_spelling_c: update dictionary 2022-09-17 21:07:30 +10:00
58241bb60b check_source: ignore single identifier comments 2022-09-17 21:07:30 +10:00
3c1f25816c check_spelling: add check for duplicate words 2022-09-17 20:35:52 +10:00
36fe8c0a2e check_cmake_consistency: include '*.msl' files 2022-09-17 19:52:46 +10:00
5883f51d35 check_spelling_c: update dictionary 2022-09-17 19:52:46 +10:00
25e9173eb5 Cleanup: spelling 2022-09-17 14:21:48 +10:00
8bb3c5189d Cleanup: remove redundant parenthesis from assert
autopep8 v1.7 added a space after assert,
remove the parenthesis as they aren't needed.
2022-09-15 12:13:16 +10:00
418aa945e3 check_spelling_c: update dictionary 2022-09-15 12:13:16 +10:00
9f82f09bd3 Credits: add Intel oneAPI 2022-09-05 17:29:46 +02:00
2a541f164a blendfile.py: add basic support for non-DNA blocks (allocated strings...).
Allocated strings or arrays of numbers have no DNA struct, they are
'raw' blocks of data in blendfiles.

Reading those was not supported so far, this commit adds basic support
for them, although user needs to know and manually call the code for the
relevant properties pointers.

Propper automated support could be added once T99875 is addressed.
2022-07-29 16:02:44 +02:00
6c65ce6cbb check_spelling_c: update dictionary 2022-07-26 13:15:14 +10:00
87684e215a blendfile: Support uchar and ushort
This is needed for the UUID data from the assets catalogs.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15508
2022-07-21 10:26:44 +02:00
da8bdd7244 autopep8_format_paths: quiet mypy warnings 2022-07-11 10:21:44 +10:00
e5ecf6b6f3 check_spelling: support ignoring hyphenated code-words
Words found in the code which were hyphenated were not being ignored,
as is done by non-hyphenated words.
2022-07-11 10:21:39 +10:00
e866b96c67 check_spelling_c: update dictionary 2022-07-11 10:21:21 +10:00
545f305efb check_licenses: exclude intern/{libmv/opensubdiv}
These directories need manual updating, the licenses in existing files
have licenses that are valid but show many warnings.

Ignore these directories for now as it gets in the way of newly
introduced warnings.
2022-07-05 13:48:31 +10:00
01b4c0e4a1 check_spelling_c: update dictionary 2022-06-03 13:51:20 +10:00
405373b86f Cleanup: remove <pep8 compliant> comment
This is no longer necessary, see: T98554.
2022-06-03 12:09:40 +10:00
ccc8fceb6b autopep8 parser: Fix parser when no autopep8 is installed
Differential Revision: https://developer.blender.org/D14983
2022-05-20 14:44:24 +02:00
b1d5eea342 Cleanup: autopep8_format_paths
- Use __doc__ for epilog.
- Keep __doc__ formatting (using raw formatter).
- Remove invalid references to `AUTOPEP8_BIN`.
- Note the purpose of arguments to autopep8.
2022-05-20 09:13:12 +10:00
18ac54d6f1 Cleanup: clang_format_paths
- Use __doc__ for epilog.
- Keep __doc__ formatting (using raw formatter).
- Ensure the version number has exactly 3 digits.
2022-05-20 09:11:32 +10:00
1f6e48a7f2 Fix autopep8 version parsing for 1.5
The code expected a version with 3 digits, while sometimes there are
only two (e.g., 1.5). This is also future proof for whenever version 2
releases.

Differential Revision: https://developer.blender.org/D14982
2022-05-19 19:38:56 +02:00
53b7c02a06 autopep8_format_paths: include ./intern
This is needed so cycles scripts are auto-formatted.
2022-05-13 19:21:01 +10:00
0cd0d5c9ae Cleanup: check_spelling_c_config, also minor spelling corrections 2022-05-11 21:01:02 +10:00
86093aef40 Fix error passing in directories to clang & autopep8 utilities
Error in [0] broke "make format PATHS=source/creator" for e.g.

Thanks to @aras_p for pointing out & suggesting the fix.

[0]: 93a5e1a46b
2022-05-10 18:43:03 +10:00
c1586ae295 autopep8_format_paths: replace environment variable with argument 2022-04-28 20:28:20 +10:00
ab775cf235 Fix error in a670766112
Missed prepending Python to the autopep8 command for the version check
2022-04-28 17:16:35 +10:00
a670766112 autopep8_format_paths: support an AUTOPEP8_BIN environment variable
This allows the makefile to pass in the path to the autopep8 in ../lib/*
2022-04-28 17:08:35 +10:00
93a5e1a46b Don't report files as being operated on which are later filtered out
This is confusing when passing one set of files to both clang-format
and autopep8.
2022-04-28 15:44:48 +10:00
f41668741c Exit when autopep8 has no work to do instead of raising an erorr 2022-04-28 15:36:54 +10:00
53c21c6213 autopep8_format_paths: add this utility to run from "make format"
This is meant as a Python version of clang_format_paths.py
even though it's possible to run autopep8 directly, supporting the same
convention means we can call both commands from "make format"
so "make format PATHS=release/scripts" can be used to to format
both C/C++ & Python code depending on the path input.
2022-04-28 15:20:51 +10:00
5bdde48aae check_spelling_c: update dictionary 2022-04-28 15:17:12 +10:00
284f78b77d check_spelling_c: update dictionary 2022-04-26 15:06:40 +10:00
3fcddd0239 pyproject: match settings from Blender's configuration 2022-04-26 15:06:40 +10:00
50c27746f2 Cycles sync: exclude blender folder, now that it's no longer in standalone 2022-04-22 19:33:14 +02:00
f40ed393a4 pyproject: autopep8 config based on the settings in Blender's root 2022-04-22 15:30:17 +10:00
d5177a3339 Cleanup: use autopep8 for files without *.py extension 2022-04-22 15:27:34 +10:00
c7928d427c rna_manual_reference_updater: generate file with autopep8 disabled
Also use spaces instead of tabs sice autopep8 makes this change
even when autopep8 is disabled.
2022-04-21 11:02:27 +10:00
e48e6feb58 autopep8_clean: enable E401, this is was almost always used already 2022-04-20 16:25:19 +10:00