Skip to content

Code Quality: Enforced code style in EditorConfig - #16441

Closed
Lamparter wants to merge 5 commits into
files-community:mainfrom
Lamparter:editorconfig
Closed

Lamparter wants to merge 5 commits into
files-community:mainfrom
Lamparter:editorconfig

Conversation

@Lamparter

Copy link
Copy Markdown
Contributor

Resolved / Related Issues

Steps used to test these changes

N/A


More details are coming soon!

@Lamparter

Copy link
Copy Markdown
Contributor Author

@0x5bfa what do you think?

@0x5bfa 0x5bfa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some of them are default values and can be omitted but LGTM.

Looks good, once this merged we'd like to run "dotnet format -w PROJ_PATH" and create spell check exclude dictionary.

Comment thread .editorconfig Outdated
Comment thread .editorconfig
dotnet_naming_symbols.constants.applicable_accessibilities = *
dotnet_naming_symbols.constants.required_prefix =
dotnet_naming_symbols.constants.required_suffix =
dotnet_naming_symbols.constants.required_capitalization = all_upper

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Pascal is fine. Title case is used in C/C++

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, we require this. The normal C# convention is to use PascalCase for constants, we should amend.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you mean use PascalCase here? I don't understand

image

The docs literally say use UPPER for constant variables.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0x5bfa fyi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG I thought I sent my message. But yes we should amend the guidelines because that convention is mostly for C/C++ AFAIK (prob in other langs too)

Comment thread .editorconfig
dotnet_naming_rule.camel_case_for_variables.style = camel_case
dotnet_naming_rule.camel_case_for_parameters.style = camel_case
dotnet_naming_rule.pascal_case_for_properties.style = pascal_case
dotnet_naming_rule.upper_case_for_constants.style = all_upper

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

@0x5bfa 0x5bfa added changes requested Changes are needed for this pull request ready for review Pull requests that are ready for review labels Nov 19, 2024
@Lamparter
Lamparter requested a review from 0x5bfa December 22, 2024 17:37
@Lamparter
Lamparter marked this pull request as ready for review December 24, 2024 17:10
@yair100 yair100 removed the ready for review Pull requests that are ready for review label Dec 30, 2024
@Lamparter
Lamparter marked this pull request as draft January 1, 2025 16:18
@0x5bfa

0x5bfa commented Jan 16, 2025 •

Copy link
Copy Markdown
Member

This has an issue:

_naming_style.asyncsuffix.required_suffix = Async`

Async event methods should not have Async suffix so this ruling is wrong.

This PR introduces many default values too, I think we should introduce one by one as required. Fyi @yaira2

@yair100

yair100 commented Jan 16, 2025

Copy link
Copy Markdown
Member

Async event methods should not have Async suffix so this ruling is wrong.

This is the pattern we've been using in Files.

@0x5bfa

0x5bfa commented Feb 24, 2025

Copy link
Copy Markdown
Member

Async event methods should not have Async suffix so this ruling is wrong.

This is the pattern we've been using in Files.

Afaik, async event methods don't have the suffix. #13567

@yair100
yair100 force-pushed the main branch 7 times, most recently from 30cea65 to decf3da Compare March 24, 2025 21:33
@Lamparter

Copy link
Copy Markdown
Contributor Author

Ultimately I will need to completely rewrite this editorconfig, but the process of creating one is tedious and requires being very familiar with the codebase styles.
I will need to take some time before this PR is ready for review.

@yair100
yair100 force-pushed the main branch 2 times, most recently from 75d29b5 to aa7d7fa Compare April 22, 2025 22:33
@yair100

yair100 commented May 14, 2025

Copy link
Copy Markdown
Member

@Lamparter is it alright if I close the PR in the meantime?

@Lamparter Lamparter closed this May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes requested Changes are needed for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Quality: Enforce code style in EditorConfig

3 participants