Conversation
|
We follow the best practices of ROS 2 styling so we wouldn't be open to using another format other than what ROS 2 recommends so that Nav2 can be a "model" codebase of when all best practices are followed, here's an example of what a good codebase would look like. If black is configured to use the same profile as ROS 2's flake8 config, then that would be really useful to have something that reformatted things. I guess I need some clarity about the intent of |
|
@SteveMacenski I guess then That said, we will never manage to marry Please confirm if you would like me to close this PR and rebase #3942 without the black changes |
|
If black can be reconfigured to use ament_flake8's configuration profile, having something that does auto reformatting would be great! But yes, we are following OSRF's coding style precisely. If additional rules are placed on things due to black that don't conflict with ROS 2's formatting, that's fine. But we will always take ROS 2's styling first. |
|
Then good life to black :) Understood and follow the ideal 👍 |
Use
ament_blackto format python code@SteveMacenski I'm only opening this pre-PR to continue #3893. The reason is simple, most python scripts have many style errors according to
flake8which can be automatically solved by using perhaps the most famous Python format,black.I have another branch where I'm fixing the missing linting tests, BUT those contain changes in the logic. The diff between main and a branch that fixes style errors + flake8 errors would be impossible to read/ follow.
This one is straightforward, I just did the following (on iron),
The only prerequisite would be to use the linter is to install the https://github.com/botsandus/ament_black linter (Yes I'm the current maintainer as well)
About
rollingrollingis still waiting to get itsament-blackpackage: ros/rosdistro#38762 . In the meantime and as a temporary solution, I'm also maintaining a Python package that strictly follows therosdistropackage versioning and implementation, thus:Future work that may be required in bullet points
I wanted to keep this PR as straightforward as possible, so in future also the commit associated with this PR is PURELY style-change, therefore;
black(I'm sure many people would love to see this change coming to the stack) then I will open another PR, adding the linter as part of the CI testsFor Maintainers: