Skip to content
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

Use consistent code formatting in src cpp files #1214

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tylervz
Copy link
Contributor

@tylervz tylervz commented Nov 6, 2024

Update .editorconfig with rules for .cpp files in the src directory and fix code formatting issues in those files.

Of the 84 .cpp files within the src directory, about 30 of them were formatted with tabs for the majority of the file. So I added this rule in .editorconfig to make 4 spaces the default indentation style for .cpp files in the src directory:

[src/**.cpp]
indent_style = space
indent_size = 4

For the most part, if a file had a mix of spaces and tabs for indentation, I'd use the indentation style which was used for the majority of lines in that file. For instance, if a file was mostly using spaces for indentation, I'd make sure that .editorconfig states indent_style = space for that file and I'd convert all the tabs to spaces in that file.

To run editorconfig-checker on the files that pertain to this pull request and verify that they now obey all the rules defined for them in .editorconfig:

git remote add tylervz [email protected]:tylervz/GP2040-CE.git
git checkout tylervz/cppCodeCleanup
npm install --save-dev editorconfig-checker
npx editorconfig-checker src/**/*.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant