Commit Graph

8 Commits

Author SHA1 Message Date
Sybren A. Stüvel f6fc417fec Black: skip string normalisation
Black (the Python formatter) shouldn't be used on Blender. However, it
is still the default formatter for some people's IDE (like mine). If
it's accidentally used, its default behaviour is to normalise strings so
they use double quotes.

This string normalisation can be tedious to recover from. This PR
configures Black so that it doesn't do that any more. This makes such a
mistake easier to recover.

An additional comment explains that Black shouldn't be used, and that
the configuration is there just to make it less annoying in case of
mistakes.

For the same reasons, this commit also includes the config option
`line_length = 120`. It just makes Black change less of our code when
it's accidentally used.
2024-01-22 10:09:33 +01:00
Campbell Barton 01e711749b pyproject: remove tools/pyproject.toml
Rely on ./pyproject.toml. This file was only separated because it was in
an external repository.
2023-03-01 22:18:28 +11: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
luzpaz 4d982cbb5d Cleanup: fix various typos
Differential Revision: https://developer.blender.org/D15304
2022-06-28 15:56:16 +02:00
Campbell Barton 42d748be34 pyproject: re-enable line wrapping for autopep8
The problem noted in the configuration file no longer occurs,
re-enabling line wrapping (E501).
2022-05-13 18:05:07 +10:00
Campbell Barton 802bc8e233 pyproject: enable aggressive, ignore E501 (line wrapping)
Aggressive needs to be enabled for many useful edits to take effect,
the ignore list is currently used to disable edits that may need
further checks/investigation before they're enabled.

Note that aggressive was already enabled for the:
source/tools/utils/autopep8_clean.py script which was previously used
when applying autopep8.
2022-04-26 14:59:41 +10:00
Campbell Barton 99fff90eab pyproject: remove settings that cause other uses of autopep8 to fail
While the ability to run `autopep8 .` to format Blender's Python code
is handy, the settings to perform this can conflict with other uses
of autopep8 (which editors may use to auto-format on save).

Some arguments now need to be passed in, e.g:

    autopep8 . --in-place --recursive --jobs=0

We'll likely include this in `make format` convenience target so the
details for invoking autopep8 shouldn't be an issue in the long term.
2022-04-24 13:41:02 +10:00
Campbell Barton 30acc5f9cd pyproject: add configuration for autopep8
This adds pyproject.toml, needed to configure defaults for autopep8.

The file is auto-discovered in a similar way to .clang-format, other
tools could be configured here too. For now just configure autopep8 so
this can be enabled in IDE's without causing unexpected edits such as
wrapping lines over 80 columns in width.

Now autopep8 can be used from the root directory by running: autopep8 .

This uses multiple-jobs to run autopep8 over all Python scripts except
paths that are explicitly ignored in exclude defined by pyproject.toml.

Reviewed By: mont29, brecht, sybren

Ref D14686
2022-04-22 10:13:39 +10:00