[🚀 Feature]: Improve .NET formatting / linting

Open
#17,023 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp
Domain
tooling

Research direction

Start with dotnet/.editorconfig and review the listed diagnostic violations. Run dotnet format style --diagnostics IDEXXXX --severity info and the documented Bazel formatting commands to investigate candidate rules. Done means selecting useful rules, fixing the relevant violations, and explicitly configuring the desired warnings.

Written by the indexing model from the issue text.

Description

C-dotnet I-enhancement
Description

#17019 created the scaffolding and #17020 added the execution for .NET linting and formatting.

The issue is to dig deeper into what things in the .NET codebase can be improved by explicit rules and consistency. Ideally it is obvious how to add good code in .NET based on the rules we have an enforce.

I'm honestly not sure how much we need or how much is enough, but I know there is more work that can be done.

Have you considered any alternatives or workarounds?

This is what I have in dotnet/.editorconfig right now for specific enforcement. The idea is to add anything that can be automatically fixed that we want to enforce as a warning, and anything that we want to enforce but can't be automatically fixed by bazel run //dotnet:format -- style / bazel run //dotnet:format -- whitespace

dotnet_diagnostic.IDE0044.severity = warning  # Make field readonly
dotnet_diagnostic.IDE0076.severity = warning  # Invalid suppression
dotnet_diagnostic.IDE1005.severity = warning  # Delegate invocation

# TODO: Additional violations to investigate
# The following are the number of violations for each diagnostic;
# They currently fail at info, the goal is to fix and explicitly set to warning above
# Investigate with `dotnet format style --diagnostics IDEXXXX --severity info`
# 1183 IDE0090
# 633 IDE0028
# 252 IDE0290
# 169 IDE0077
# 66 IDE0130
# 65 IDE0300
# 57 IDE1005
# 42 IDE0017
# 39 IDE0039
# 36 IDE0063
# 33 IDE0306
# 31 IDE0083
# 30 IDE0016
# 30 IDE0059
# 26 IDE0305
# 18 IDE0031
# 12 IDE0270
# 11 IDE0057
# 11 IDE0054
# 9 IDE0350
# 9 IDE0074
# 7 IDE0060
# 3 IDE0150
# 2 IDE0038
# 1 IDE0056
# 1 IDE0034
# 1 IDE0018
# ? IDE1006
Dominant language
Java
Stars
34.6k
Forks
8.7k
Avg merge
1d 16h
Merged PRs (30d)
107

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SeleniumHQ/selenium

All issues in SeleniumHQ/selenium

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.