colcon-cargo icon indicating copy to clipboard operation
colcon-cargo copied to clipboard

Add script / instructions for running the code formatter locally

Open bergercookie opened this issue 5 years ago • 2 comments

Currently each developer has to setup flake8 on their own and look into the test_flake8.py for what rules should be ignored and what files to run it on.

Unrelated to this but, @dirk-thomas what's your opinion about switching to black or leave it up to each extension to decide the formatter/linter of choice?

I've used black consistently, it has excellent editors support and I haven't seen any notable bug when using it. It can be used both as a linter or as a formatter, and we can also lose the test_flake8.py file as well.

bergercookie avatar Nov 09 '20 11:11 bergercookie

Since each package already decides it's own tests this package can use whatever it prefers. I don't see a strong reason to change what is used for other packages though.

dirk-thomas avatar Nov 09 '20 16:11 dirk-thomas

@lelongg , what do you think of using black in this repo?

There might be a first PR that changes multiple lines to adhere to black, (e.g., changing single quotes to double, which is also reported as a warning by flake) but after that, maintaining it and checking for errors both for developers and in CI will be simplified significantly IMO.

I can make a first pass + PR to show you how that would look..

bergercookie avatar Nov 10 '20 08:11 bergercookie