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

Unsorted 'using' statements vs merge conflicts #1681

Closed
raman-m opened this issue Jul 24, 2023 · 0 comments · Fixed by #1682
Closed

Unsorted 'using' statements vs merge conflicts #1681

raman-m opened this issue Jul 24, 2023 · 0 comments · Fixed by #1682
Assignees
Labels
bug Identified as a potential bug merged Issue has been merged to dev and is waiting for the next release

Comments

@raman-m
Copy link
Member

raman-m commented Jul 24, 2023

Expected Behavior

All using statements are:

  • sorted, and not used ones are removed (via Visual Studio refactoring action "Remove and Sort Usings")
  • defined in a block which starts at the beginning of the file before namespace declaration

Merge conflicts should go away in PRs. At least rebasing feature branches will be easier.

Actual Behavior / Motivation

There are multiple merge conflicts in old PRs which block code review and PR management.

Steps to Reproduce the Problem

SA1135 violation was since the StyleCop adding to the solution by df86052, the rule violation was not fixed till #1663 because most of C# files had using block inside of namespace declarations.
The situation with conflicts became worst after merging #1663 where StyleCop violations of SA1135 rule (of Readability Rules) were fixed.

Specifications

  • Version: latest, 19.0.2
@raman-m raman-m added bug Identified as a potential bug small effort Likely less than a day of development effort. accepted Bug or feature would be accepted as a PR or is being worked on labels Jul 24, 2023
@raman-m raman-m self-assigned this Jul 24, 2023
@raman-m raman-m added the in progress Someone is working on the issue. Could be someone on the team or off. label Jul 24, 2023
raman-m added a commit that referenced this issue Sep 25, 2023
* samples

* Ocelot

* Ocelot.*

* tests

* Add ImplicitUsings property to the projects (C# 10)

* Upgrade xUnit setup in test projects

* Add global usings

* Remove Unnecessary Usings.
IDE0005: Using directive is unnecessary.

* IDE0001: Name can be simplified.
Remove 'global::' prefix

* IDE0005: Using directive is unnecessary.
Remove and Sort Usings

* IDE0005: Using directive is unnecessary.
Remove Unnecessary Usings

* Disable implicit usings

* Add required usings

* Global usings

* Add required namespace
@raman-m raman-m added merged Issue has been merged to dev and is waiting for the next release and removed small effort Likely less than a day of development effort. accepted Bug or feature would be accepted as a PR or is being worked on in progress Someone is working on the issue. Could be someone on the team or off. labels Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identified as a potential bug merged Issue has been merged to dev and is waiting for the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant