Commit Graph

19 Commits

Author SHA1 Message Date
Campbell Barton
ad7150dcca Tools: improve code_clean's 'remove_struct' edit to avoid CPU overhead
Many struct removals were being tested which always failed.
Avoid testing removal of forward declarations & struct declarations.
2023-07-25 13:24:59 +10:00
Campbell Barton
481eaff790 Tools: improve code_clean's 'use_brief_types' edit to skip typedef's
`typedef unsigned int uint;` could be converted into
`typedef uint uint;`.

Resolve by skipping instances of unsigned that follow a typedef.
2023-07-25 13:24:59 +10:00
Campbell Barton
22354e8f84 Tools: add --verbose argument for code_clean.py
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.
2023-07-21 11:08:24 +10:00
Campbell Barton
c1cb7f0900 Tools: more efficient grouping of edits code_clean.py
Group edits where possible, instead of waiting for each edit to complete
for all files. This avoids bottlenecks on single files as much.
2023-07-21 00:13:13 +10:00
Campbell Barton
b1daf6bfad Tools: add --jobs arguments to clang checker and code-clean tool
Setting jobs to one is useful for debugging, reducing the number
of threads can be useful for code_clean as a background task.
2023-07-21 00:13:13 +10:00
Campbell Barton
1dec7189ed Fix '--help' message error in code_clean when '%' characters were used 2023-07-13 09:54:05 +10:00
Campbell Barton
feb83e66c6 code_clean: add use_empty_void_arg cleanup operation
Removes the use of (void) in C++ for functions with no arguments
2023-07-02 19:54:27 +10:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Campbell Barton
8f109712ee License headers: use SPDX-FileCopyrightText for build_files/ & tools/ 2023-06-14 23:36:23 +10:00
Hans Goudey
7d935f94f3 Cleanup: Grammar: it's vs its 2023-06-13 14:51:49 -04:00
Campbell Barton
e2cb52594a code_clean: add 'remove_struct_qualifier' edit
Removes struct qualifier when it's not needed.
2023-05-31 17:12:19 +10:00
Campbell Barton
b18b7c1de1 make format: include tools/ as it's no longer a sub-module 2023-05-27 13:43:33 +10:00
Campbell Barton
2f9538a8c7 code_clean: add utility for replacing BLI string copy/printf with macros
These macros have the advantage of being less verbose and disallowing
sizeof(..) referencing the size of a pointer. e.g. #107443.
2023-05-09 13:16:09 +10:00
Damien Picard
3f0d2cf9e1 Add scripts dir to the make format paths for Python
`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
2023-04-20 05:30:34 +02:00
Campbell Barton
31147c90c4 code_clean: restrict 'use_function_style_cast' edits to C++
Allows running multiple edits at once on C & C++ files without
C++ edits being attempted on C source.
2023-03-21 19:50:46 +11:00
Campbell Barton
bd0aa88909 Fix invalid path references after moving tools & scripts 2023-03-01 22:00:46 +11:00
Sergey Sharybin
9b70039014 Fix paths in the auto-formatting tools
Those got missed in the submodule change commit.

Pull Request #105178
2023-02-24 15:52:34 +01:00
Sergey Sharybin
e28a9a87c9 Fix references to the /release/scripts directories
Those were moved to the /scripts
2023-02-21 18:40:47 +01:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00