Open
Conversation
…ns for github copilot for style context.
…the issue with function definitions having "array *" at the end of types instead of "array*". Also, there were extra spaces in the header files. I fixed the issue with cuda files having extra spaces around the <<< and >>>, plus indentation issues with the kernel calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation Changes
Purpose
The purpose of these file additions is to add OPTIONAL style encouragement to our developers. Included files are a copilot-instructions.md file, which I have been working on, as well as a formatting configuration script for uncrustify.
The goal of this is to encourage style consistency in our code without imposing or forcing others to use it. It simply is an encouragement for consistency in our code base. I have found this instruction file for the AI agents to be effective in encouraging the best programming practices that we aim to model in our code.
Please feel free to contribute and commit to this branch. No PRs into this branch are necessary. If you see something you'd like to change, please change it, but don't delete the formatter or agent instruction files.
Affected Areas
.github folder, as it relates to automation. Putting the formatting file is questionable here; however, I think it is acceptable here to limit files in the root directory, as well as the automation aspects of CI and that formatters can (but will not here) be used for pre-commit formatting.
Changes Made
Files added.
Example formatted files are shown from modules I personally wrote (position_map)
Reason for Change
I am getting very annoyed at the inconsistencies in our code and how different programmers write differently, which makes the code base difficult to read. I've caught some very obvious mistakes recently regarding unindented code, and it makes it more difficult to read.
I decided to not use a linter for this, as linting and formatting are seperate tasks. Linters focus on code correctness, while formatters focus on style and presentation. For instance, a linter would detect if the wrong variable is passed to a function, but a formatter will correct indentation. I'm aiming to have a style guide in this PR so that we can unify the style in our code base. Here, my annoyances have more to do with spaces, indentation, and brace conventions than anything else.
Additional Notes
These are encouragements, not forced to use. Uncrustify was chosen for its customization, which clang-formatter lacks. We have a very unstandard way of programming in this codebase and we needed a highly customizable formatter. The config file and scripts were generated with the use of copilot + claude opus 4.5 for research and figuring out what each parameter does. Human validation and verification for correctness was performed with thorough testing and understanding such that we are not comitting poorly understood code.
Checklist
Grievances
This is the most fundamental issue I have with the formatter
In the codebase, we have function calls like this.
However, the formatter cannot tell when to double-indent (4 spaces) the inside braces struct definition and would otherwise try to swap the indenting of the brace and parentheses. I compromised by putting the parentheses on the same line as the brace end.
This is acceptable because it is the end of the function call and the end of the struct arguments, which is one line of the function ending and only one layer of indenting.
As far as I can tell, these are the only significant changes to our style. Everything else you might disagree with likely has examples done the way the formatter is doing it.
If you would like to avoid this indentation style, simply specify the struct before as a variable
I filed an issue with uncrustify about this. uncrustify/uncrustify#4619