-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
EditorConfig file added and documented #203
Open
frobijn
wants to merge
7
commits into
nanoframework:pages-source
Choose a base branch
from
frobijn:EditorConfig
base: pages-source
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9c7a653
EditorConfig file added and documented
e53d4e7
Merge branch 'nanoframework:pages-source' into EditorConfig
frobijn 2c6bc46
EditorConfig and spell checker added and documented
37a3188
Static fields should be prefixed with s_ (not can)
f0286c5
Merge branch 'pages-source' into EditorConfig
12ee5ff
Merge branch 'pages-source' into EditorConfig
dc161b7
Source of the nanoFramework .editorconfig added.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# EditorConfig for Visual Studio 2022: https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022 | ||
|
||
# This is a top-most .editorconfig file | ||
root = true | ||
|
||
#===================================================== | ||
# | ||
# Settings for all file types | ||
# | ||
#===================================================== | ||
[*] | ||
|
||
# Generic EditorConfig settings | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = crlf | ||
charset = utf-8-bom | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
# Visual Studio spell checker | ||
spelling_languages = en-us | ||
spelling_checkable_types = strings,identifiers,comments | ||
spelling_error_severity = information | ||
spelling_exclusion_path = spelling_exclusion.dic |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nano | ||
intellisense | ||
nanoff |
Oops, something went wrong.
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.
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.
we don't reinforce the s_ and t_. IT's just a recommendation. But we do reinforce the _
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.
In dotnet's .editorconfig there is a rule that checks for this. You'll get a message that says "naming rule violation". As a simple contributor I would read that as a "must".
Also: see nanoframework/nanoFramework.Networking.Sntp#134 about this. I'm confused what is expected of me. I think if you produce a message about it, then it is part of the coding style.
Leniency is another question: how much can you deviate from the coding style? That is: when will your contribution be rejected because you first need to clean up the code. I guess if only the "s_" are missing, the contribution is accepted. But there may also be other violations that are acceptable...
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.
For automated checks we have to choose one or the other. I'm afraid we can't have recommendations...
If we are stating that we are following .NET code style (which we aim to) then let's play ball and have those
s_
prefixes.No harm with that, it's just a convention.
Now, we will have extra work to "fix" these as we add the rules to the class repos and update the native code. But that's life. 😅
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.
As for the contribution being accepted or not, considering that we'll have the editorconfig and will enable the check during the build in the pipeline, I suppose that makes it quite clear.
There is always a human reviewing the PRs and we try to be very friendly with the review comments. So not much to worry about.
For existing code, there will an extra step as we add the rules to the repos which will be making sure the code is compliant and make the necessary fixes.