Commit Graph

263 Commits

Author SHA1 Message Date
Campbell Barton 27cb0e18b7 code_clean: skip "parenthesis_cleanup" in macro definitions
Don't remove parenthesis in macro definitions as it's important to keep
parenthesis around arguments.
2023-07-27 12:10:14 +10:00
Campbell Barton 4fd3ec6337 Tools: code_clean: add a default value for '--edits' & '--match'
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.
2023-07-25 13:25:19 +10:00
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
Dalai Felinto 29b67ad31b Manual Reference: Includes the copyright
This was an oversight on the license headers copyright pass [1].

Also since the manual reference is generated by this script
we can update the copyright year every time.

[1] - 8f109712ee
2023-07-21 14:18:46 +02: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 08f4f1f41e Cleanup: spelling in comments, capitalize tags 2023-07-20 09:42:00 +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 f9316e4079 Cleanup: spelling in comments 2023-07-12 12:45:35 +10:00
Dalai Felinto 9e3bd8a2d0 Fix gitea inactive script duplicated results
Although we had only 190 developers, the script
was accusing a total of 365 developers (with 188 inactive).

There were two problems here:
* The gitea API was only using the `limit` paramater when an explicit
  page was passed.
* There was a bug with the get_next_page code, that would skip the last
  page.

I now made the page always an explicit argument passed to fetch_single.

With this fix we now get: 190 developers with 98 inactive.
2023-07-10 17:00:58 +02:00
Campbell Barton 23acedd432 Cleanup: code-comments 2023-07-07 15:11:19 +10:00
Campbell Barton 785bd13b9a Cleanup: spelling in comments 2023-07-05 14:09:33 +10:00
Jeroen Bakker 8f00659fb7 Cleanup: make format 2023-07-04 07:51:11 +02:00
Thomas Dinges 3346d433ee Credit Script: Update lookup table to deduplicate authors. 2023-07-03 15:41:07 +02: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 ffab21a3ef Cleanup: format 2023-07-02 19:54:26 +10:00
Bastien Montagne 56e9abf133 Update credits_git_gen tool to also parse co-authors in commit messages,
Co-authors listed following the `Co-authored-by:` format in a commit
message will be automatically added to the list of contributors.

Further more, it is now possible to overwrite authors informations from
git commits with embedded data, in case it is necessary to correct some
commit's author information after the commit has been pushed.

Implements #109438.

Pull Request: https://projects.blender.org/blender/blender/pulls/109468
2023-06-30 14:52:53 +02:00
Campbell Barton d1e6c8f5a6 Cleanup: spelling in comments 2023-06-28 12:27:48 +10:00
Campbell Barton 8cd877641d check_licenses: minor improvements to output
Right align numbers and use thousands separator.
2023-06-22 12:35:51 +10:00
Brecht Van Lommel f4e6981513 Merge branch 'blender-v3.6-release' into main 2023-06-21 15:15:23 +02:00
Brecht Van Lommel 17fa168a3d Linux: add launcher script to fix issue launching on Steam
The steam environment sets LD_LIBRARY_PATH with a libtbb.so.2 that is
incompatible with our own. This wrapper scripts gives our own library
priority.

There is a more modern "Steam Linux Runtime" that can be used instead of
the "LD_LIBRARY_PATH Steam Runtime" and which launches Blender, but it
fails to detect GPU compute libraries. So that was not an option.

Ref #107385

Pull Request: https://projects.blender.org/blender/blender/pulls/109169
2023-06-21 14:49:27 +02:00
Campbell Barton d1e63f89bb License checker: quiet false positive for blender_theme_as_c.py 2023-06-15 16:47:51 +10:00
Campbell Barton 1b508de749 License headers: use SPDX-FileCopyrightText in intern/opensubdiv 2023-06-15 16:47:51 +10:00
Campbell Barton 60d90de9a5 Cleanup: remove unused imports, quiet pylint warnings 2023-06-15 13:35:34 +10:00
Campbell Barton 9ddbbbfeae License checker: check for SPDX-FileCopyrightText: in the header 2023-06-15 13:35:34 +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 2f1899a7fa Cleanup: spelling in comments 2023-06-09 11:40:50 +10: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 d133d622c1 Merge branch 'blender-v3.6-release' 2023-05-27 13:47:02 +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 13c815085b Cleanup: spelling in comments 2023-05-24 11:21:18 +10:00
Campbell Barton bf36a61e62 Cleanup: spelling in comments & some corrections 2023-05-20 21:17:09 +10:00
Campbell Barton 0099f51cdd Cleanup: sort file, uppercase booleans, add missing headers
Also update files to ignore for check_cmake.
2023-05-17 13:13:10 +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
Campbell Barton ba3d7499fa Cleanup: spelling, use term polygons in polygon callbacks 2023-05-05 09:46:28 +10:00
Campbell Barton 0c27c6f876 Cleanup: spelling in comments
Also remove redundant comment.
2023-04-28 12:23:29 +10:00
Campbell Barton db1af0e325 Cleanup: spelling in comments 2023-04-26 16:14:07 +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 6722f90734 Cleanup: quiet mypy warnings in gitea_inactive_developers
Also add to the list of scripts to check with "make check_mypy".
2023-04-16 17:03:56 +10:00
Campbell Barton 8afb8db66e Cleanup: spelling in comments 2023-04-16 16:24:38 +10:00
Dalai Felinto 23bce32888 Tools: util to get inactive member of teams from gitea
Note, at the moment it is using the last login as a criteria to
whether the person should be listed (comparing it to 2 years past).

However anyone who hasn't logged in in gitea yet shows as last login 1970.

To run this you need to install all the required python packages and
generate a token with scope "read:org" or "admin:org".

See:
https://projects.blender.org/infrastructure/blender-projects-platform/issues/55
2023-04-14 14:54:26 +02:00
Campbell Barton 440cccecdc Cleanup: spelling in comments 2023-04-05 14:39:51 +10:00
Campbell Barton bb2dc141f2 Cleanup: spelling in comments 2023-03-27 12:08:14 +11:00
Hans Goudey cef82a1d39 Cleanup: Grammar: "it's" vs "its" 2023-03-24 08:34:21 -04: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 d64dfc4333 Cleanup: spelling in comments 2023-03-10 12:58:10 +11:00