-
Notifications
You must be signed in to change notification settings - Fork 16.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DevEnv: Finish out the astylerc settings #19009
Comments
the issue with the formatter is that we aren't conform to our own style on some files for readability so, I doubt it will work. |
Hi there folks... is this issue still open? I would love to work on it but I'll need a bit of guidance as it will be my first issue.. |
I think I might have done that here. This isn't merged so nothing has been completed really. TunaLobster/ardupilot@pr/udpate-pre-commit...TunaLobster:ardupilot:pre/add-astyle-pre-commit There might be a few more optional astyle things that I missed while reading through the docs. Like khancyr said, if there is a better linter for us, that would work too. |
So I went through the style documentation page and understood what astyle is and how it is being used in the directory. This is the link of what I referred https://ardupilot.org/dev/docs/style-guide.html Here I found below things that can be fixed here -> ardupilot/Tools/CodeStyle/astylerc
Control statements (if, while, do, else) should always use braces around the statements Other Braces:
|
I found a major problem with the astyle setting. We're using astyle in parts of the codebase and enforcing it in CI. But, it's doing nonsensical things. Did anyone have a plan for why the astyle config is added to the repo and used, but it's not apparently finished? |
astyle was there years ago, nobody enforced it nor make a clean configuration. We can switch to another tool if we can have some consitent. Main issue is that we cannot make a first pass to clean the full repo as that breaks all PRs and history. Second one, is that on some part of the code we are doing manual indention for "easier reading" and linter cannot cope with those |
Ok. If astyle is known to be broken, perhaps we need to remove it from the repo and remove all tooling using it. clang-tidy supports adding ignores, so you can do manual indent and tell the linter not to touch it. Or, configure the linter to manually indent your matrices. See this PR for a partial solution to the history problem: #25609 |
For the lack of correct formatting in a struct with brace initialization, upgrading to astyle 3.2 should fix it. Ubuntu 22 comes with 3.1. |
* See ArduPilot#19009 (comment) Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Feature request
Problem:
Currently the astylerc file works well for some files, but it does not work well for headers. It also does not include all of our formatting guidelines causing some odd results when using it and not following all of the guidelines at the start.
Solution:
Going through the long list of defaults that astyle implements and correcting the ones that need to be changed. Adding in checking for header files.
Platform
[x] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
The text was updated successfully, but these errors were encountered: