-
Notifications
You must be signed in to change notification settings - Fork 321
Update coding/file style guidelines #3923
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates repository-wide formatting defaults and documents new style guidelines (encoding, line endings, and line length) while keeping C# indentation at 4 spaces.
Changes:
- Update
.editorconfigdefaults (2-space indent, LF, UTF-8, trim trailing whitespace) with explicit overrides for C# and Windows scripts. - Refresh
policy/coding-style.mdto add new repo-wide text file rules and wrap lines to ~100 chars. - Remove redundant file-type-specific
.editorconfigsections now covered by the new defaults.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| policy/coding-style.md | Adds/rewraps guidelines (UTF-8/LF, 100-char lines) and reformats the rules list. |
| .editorconfig | Changes default formatting settings and simplifies per-file-type overrides (keeps C# at 4 spaces, Windows scripts CRLF). |
.editorconfig
Outdated
| [*.{yml,yaml}] | ||
| indent_size = 2 | ||
| # Use Unix-style line endings. | ||
| end_of_line = lf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of our files are already LF, so this seemed to make sense. VSCode won't change an existing file automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one messes with things... Git default behavior at install on Windows is to checkout crlf and check in lf. Changing this at the IDE level will cause a flurry of warnings when commiting, iirc. While I agree, having consistent line ending is a good thing at the repo level, the conflict between IDE (editorconfig) and scm (git) will make a mess of things for Windows users.
For the record, you see that our files are LF already because you're working from linux :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I will remove it and let individual devs decide based on their git and IDE config.
benrr101
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provisionally approving it...
664a199
Changes to default settings:
C# specific:
Windows scripts:
Removed sections:
Coding style:
New guidelines added:
Formatting improvements: