Menu

#4 -sc doesn't work (because of a typo)

open
nobody
None
5
2009-04-09
2009-04-09
th-weller
No

The -cs option does not work.

After I played around for almost a day, I inspected the source code. It turned out that there is a simple typo in the 'Main' function:

In Program.cs at line 47/48:
new StyleCopReport().ReportBuilder()
.WithStyleCopSettingsFile(cl.GetOptionValue("s"))
...

must be instead:
new StyleCopReport().ReportBuilder()
.WithStyleCopSettingsFile(cl.GetOptionValue("sc"))
...

Tip: Always use constants for values (strings, numbers or anything else) that you need more than once... ;-)

Regards
Thomas

Discussion

  • dave

    dave - 2012-06-13

    Hi,

    i corrected

    WithStyleCopSettingsFile(cl.GetOptionValue("s"))

    to

    WithStyleCopSettingsFile(cl.GetOptionValue("sc"))

    and recompiled, but still the program ignores my Settings.StyleCop.

    When i debug StyleCopCmd, i can see, that the path of my Settings.StyleCop with option -sc is correctly forwarded.

    Please, can anybody help me to get this bug fixed?

     
  • Anonymous

    Anonymous - 2012-07-03

    I've corrected

    WithStyleCopSettingsFile(cl.GetOptionValue("s"))

    to

    WithStyleCopSettingsFile(cl.GetOptionValue("sc"))

    as well, but in addition I've referenced the newest libraries from StyleCop 4.7.33, fixed minor errors and now StyleCopCmd uses my local settings (-sc Settings.StyleCop).

     

Log in to post a comment.