dotnet / codeformatter

Tool that uses Roslyn to automatically rewrite the source to follow our coding styles
MIT License
1.24k stars 244 forks source link

Introduce local\global classification for rules based on analyzers #207

Closed srivatsn closed 8 years ago

srivatsn commented 8 years ago

Introduce the concept of local and global rules for analyzers such that all local fixes can be applied together whereas global rules will have to be applied one by one.

This is necessary to fix an issue where the remove unused using fixer was removing an using that only became necessary by the "Make type explicit" fixer and they cannot be applied together.

This PR also implements the rule about placing usings outside the namespace as analyzers\fixers. The original rule in the Rules directory tries to simply move the using syntactically but that is incorrect. If there's using A inside namespace B then when moved out it might have to using B.A and so we need semantics. Fixing that in the analyzer and adding tests.

srivatsn commented 8 years ago

@lgolding @michaelcfanning @genlu @mavasani

srivatsn commented 8 years ago

@dotnet/roslyn-analysis

ghost commented 8 years ago

:+1: with some comments.