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

Run autofix across the entire solution #2147

Closed
alexandru-calinoiu opened this issue Jun 8, 2016 · 10 comments
Closed

Run autofix across the entire solution #2147

alexandru-calinoiu opened this issue Jun 8, 2016 · 10 comments
Labels

Comments

@alexandru-calinoiu
Copy link

Is there a way I can run autofix across the entire solution, let's say I want the this prefix to be applied to all the files in the solution.

@sharwell
Copy link
Member

Do you mean from a command line, or from within Visual Studio?

@darrensteadman
Copy link

I'm interested in this as well, Is it possible to just tell Visual Studio to auto fix an entire file?

@tiesmaster
Copy link

@darrensteadman In Visual Studio, this is possible for the current document, project, or even entire solution (already from the very first release of VS with analyzers):
image

@sharwell Do you know of any oss tools out there that will run code fixers on an entire solution, as a command line tool?

@alexandru-calinoiu
Copy link
Author

@tiesmaster yes, rubocop a linter for linux simply run rubocop -a and it will autofix all the issues it can, there is also eslint that has a similar ability

@tiesmaster
Copy link

@alexandru-calinoiu Thnx for the tips, however, I was talking about tools that allow you to run the Roslyn analyzers/code fixers, as what this project is about.

@IanKemp
Copy link

IanKemp commented Jun 1, 2018

Why was this closed? The question wasn't answered.

Being able to run a command-line Roslyn tool to do codefixes e.g. on checkin would be incredibly useful - I'm not averse to building something like that myself, but obviously if there is already an official/recommended tool that does this, I'd prefer to use it. If not, the extension points that would be needed, or pointers in the right direction, would be very welcome - although I suspect the fact that MSBuildWorkspace is still MIA (see dotnet/roslyn#17974) will be a problem.

@tiesmaster
Copy link

I'm also interested to see something like that the day of light. I believe the Roslyn team(s) are working on something like that, and if it's "Fix most code style violations in the current document with a single click." on the VS 2018 roadmap, then it should be due at the end of the month ;) Though, looking at this issue, I see there is still a lot to do ;)

@sharwell
Copy link
Member

sharwell commented Jun 1, 2018

@IanKemp There is no officially supported mechanism to do that. If you build this repository from source, the StyleCopTester tool may be able to provide some untested/unsupported functionality that looks like this. See #2017. The version of this tool in the master branch already uses the replacement for MSBuildWorkspace.

@rdcm
Copy link

rdcm commented Feb 23, 2022

Any updates on this?

@sharwell
Copy link
Member

@rdcm No one is watching or working on this. I would suggest filing an issue on dotnet/roslyn if this is a feature of interest to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants