The updated autopep8 was ignoring the "exclude" values because
they started with a "./" instead of a "/".
The documentation I found doesn't go into details, even if this is a
regression in autopep8, update the configuration as it causes
"make format" to format files that aren't meant to be modified.
This renames the mode identifiers to be consistent with e.g. the context mode identifiers and other names used for the new Grease Pencil.
For `object.mode`:
* `PAINT_GPENCIL` -> `PAINT_GREASE_PENCIL`
* `SCULPT_GPENCIL` -> `SCULPT_GREASE_PENCIL`
* `VERTEX_GPENCIL` -> `VERTEX_GREASE_PENCIL`
* `WEIGHT_GPENCIL` -> `WEIGHT_GREASE_PENCIL`
For the internal `ob->mode` flag:
* `OB_MODE_PAINT_GPENCIL_LEGACY` -> `OB_MODE_PAINT_GREASE_PENCIL`
* `OB_MODE_SCULPT_GPENCIL_LEGACY` -> `OB_MODE_SCULPT_GREASE_PENCIL`
* `OB_MODE_VERTEX_GPENCIL_LEGACY` -> `OB_MODE_VERTEX_GREASE_PENCIL`
* `OB_MODE_WEIGHT_GPENCIL_LEGACY` -> `OB_MODE_WEIGHT_GREASE_PENCIL`
Resolves#127374.
Pull Request: https://projects.blender.org/blender/blender/pulls/128604
As of [0] `intern/itasc/` is excluded from formatting,
however the formatting script was still running clang-format
on files in this directory.
Support ignoring directories to avoid the overhead of running
clang-format which does nothing.
Also add comments & skip creating paths to convert to spaces when
converting tabs to spaces isn't enabled.
[0]: 77617fce77
Directories in intern/ were selectively formatted based on
paths in `tools/utils_maintenance/clang_format_paths.py`.
This had the following problems:
- Editing files inside intern/ would auto-format on save with editors
setup to auto-format as there was nothing to disable formatting.
- Some directories were missing (by accident it seems).
Resolve by formatting all of `./intern/` exclude except for
`./intern/itasc/` which includes ITASC & KDL versions we might
want to sync with upstream.
When passing `.py` paths to the format command, clang-format paths
would be empty and operate on all paths.
Resolve by detecting cases when there is nothing to format.
Ref: !126055
When autopep8 is accessed as a Python module (using `--no-subprocess`),
which is now default on MS-Windows.
- Perform version checks on the module version instead of the command.
- Remove checks for the command existing in the PATH.
- Adjust errors to make sense for a Python module.
autopep8_format_paths.py was never wired up in the windows tooling,
this PR wires it up, to get around a 8191 limitation for command
lines on windows an alternative "--no-subprocess" option has been
introduced to call the pep8 module directly from python.
TODO: A subprocess is still used for getting the version information
Contributors:
- @campbellbarton fixes to autopep8_format_paths.py to support
the -no-subprocess option.
Pull Request: https://projects.blender.org/blender/blender/pulls/120794
As this is only added to set strict warnings, cleaning logic would
remove as the compilers output is unchanged.
Support excluding headers from removal, others can be added if needed.
Along with the 4.1 libraries upgrade, we are bumping the clang-format
version from 8-12 to 17. This affects quite a few files.
If not already the case, you may consider pointing your IDE to the
clang-format binary bundled with the Blender precompiled libraries.
Previously this was the double the CPU count because:
- Modern CPU's from AMD & Intel support SMT/hyper-threading which
present twice as many cores, doubling again has little to no benefit.
- Using 2x or 4x the number of physical cores number can use a lot of
memory on systems with many cores which are becoming more common.
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
Each edit-generate now declares if it's generally considered safe
(isn't likely to make changes that break on other platforms for e.g.)
Default edits are now used when --edits is omitted.
The match argument now defaults to files with c/cc/cpp extensions when
omitted.
It's now possible to run:
./tools/utils_maintenance/code_clean.py {BUILD_DIR}
Which gives results that can be used with a very low risk of causing
functional changes or breaking other platforms.
Support `--verbose compile,edit_actions` (one or both can be selected),
to output the compiler output of each edit and the text (before/after).
This replaces existing hard-coded values.
Other minor changes:
- Print the file-path for each edit for better context.
- Print skipped edits when multiple edits are passed in so other
edits might be applied separately are listed.
`make format` uses autopep8 to format Python, using a list of paths
specified in `tools/utils_maintenance/autopep8_format_paths.py`. The
scripts folder used to be a submodule inside release, but it is now at
the root of the blender repo.
This commit adds `scripts` to the list of paths to format.
Ref !107143