-
Notifications
You must be signed in to change notification settings - Fork 28
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
Feature ideas - MaxWarnings and AutoLowerMaxWarnings #22
Comments
Thanks for the suggestions! Making it easier to start using the tool in a legacy codebase sounds like a relevant scenario and should be supported. However, relying on issue count seems a bit fuzzy. How about specifying areas of the codebase to be temporarily excluded from analysis? E.g. defining source file include/exclude lists (with wildcards)? So those files that contain unresolved dependency problems could be excluded; or the other way around: including only those files that were "cleaned". This way the config file could explicitly reflect the problem areas (or clean areas) instead of just holding some magic number of tolerated issues. What do you think? Would it be a solution in your case? And best wishes for you and the arriving baby! |
Thanks for the advice :) I'm going to have to stick up for I've worked somewhere where we used a MaxWarnings approach to successfully reduce StyleCop errors from 100000+ to ~1000 over a period of months. It 'nudged' the team into adopting the standards, but gave them a little flexibility if they needed it (e.g. they could manually increase the count if it became necessary in order to meet delivery targets). In many of the organisations where I think NsDepCop would be most useful, spending time enforcing layering isn't a priority (devs have to deliver features, architects are more worried about establishing boundaries via microservices). I suspect having fine-grained control over the exclusions would mean that no-one would spend the time necessary to configure them correctly. The rules that are needed are along the lines of |
Okay, I've created a milestone to address this (v1.8). |
Awesome! |
Hi, I have an idea for a couple of new settings which would be a big help when introducing NsDepCop into legacy projects.
Right now, if I were to add NsDepCop to a legacy project at work, there would be lots of violations as the layering isn't correct. This makes it hard to bring in as I can't set NsDepCop to raise errors (there are too many to fix) and if I set it to warning mode, then other developers will ignore the violations.
I was thinking that a new rule attribute
MaxWarnings
could be added that would throw an error if there are more than a certain number of warnings would be very useful. I could set it to the current number of violations and ensure that no new (or at least no more) violations are added, so the codebase wouldn't get any worse.Another setting could then be
AutoLowerMaxWarnings
. This would change the MaxWarnings value in the config file to the current number of violations IF the current number is less than MaxWarnings. This would mean that developers could reduce the number of violations, but they couldn't increase them.These settings could work both at an individual rule level, or for all rules.
What do you think? It would be great to have these features on the roadmap. If you like the sound of them, then I could maybe take a look when I get a chance*.
*I have a baby arriving in the next 3-4 weeks so it might be a while though!
The text was updated successfully, but these errors were encountered: