These are chat archives for DotNetAnalyzers/StyleCopAnalyzers

14th
Nov 2017
Sam Harwell
@sharwell
Nov 14 2017 05:00
@/all if you work on this project you may want to try this: https://blogs.msdn.microsoft.com/dotnet/2017/10/30/real-time-test-discovery/
Dirk Lemstra
@dlemstra
Nov 14 2017 07:29
@sharwell It is a lot faster than it used to be but I will enable this when 15.5 leaves preview.
Johan Larsson
@JohanLarsson
Nov 14 2017 08:13
Bikeshed: Local functions defined at the beginning or end of the declaring member?
One part of me wants them in the beginning and that is what I have done until now
It hurts reading a bit though.
Advantage with having them at the end of the block would be the declaring member would read like an ordinary member that just happens to make calls to a local function
kkrzysiek
@kkrzysiek
Nov 14 2017 09:26
Hi
I would like to ask if after addind stylecop.analyzers to the project, there is a way to see all the warnings?
or I have to go file by file?
Yaakov
@yaakov-h
Nov 14 2017 09:27
compile and they should show up in the Errors pane in VS
kkrzysiek
@kkrzysiek
Nov 14 2017 09:28
perfect! :)
next question
and I am receiving warning SA1000 (IF keyword must be followed .... )
but I don't see this text anywhere in above schema - so where is it?
Yaakov
@yaakov-h
Nov 14 2017 09:31
I don't understand the question
kkrzysiek
@kkrzysiek
Nov 14 2017 09:32
after getting NuGet "StyleCop.Analyzers" I have created the stylecop.json file
the file is almost empty, there is this: "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
"companyName": "PlaceholderCompany"
}
}
so I understand that the schema which is under this URL will be used -
correct?
kkrzysiek
@kkrzysiek
Nov 14 2017 09:38
I am receiving warning SA1000 - "The keyowrd 'if' must be followed by a space"; but I do not see this rule anywhere in the schema from that URL
so I wonder where is this rule defined, for example if I would like to switch it off
Yaakov
@yaakov-h
Nov 14 2017 09:41
you need a Ruleset file to turn up/down/on/off rules
the rules themselves are defined in the analyse assembly
kkrzysiek
@kkrzysiek
Nov 14 2017 09:42
okay so this file you are talking about, isn't it the stylecop.json file ?
Yaakov
@yaakov-h
Nov 14 2017 09:42
no
kkrzysiek
@kkrzysiek
Nov 14 2017 09:42
okay so what is this file used for?
Yaakov
@yaakov-h
Nov 14 2017 09:42
as I understand it, tweaking/customizing rules
but it's non-standard
kkrzysiek
@kkrzysiek
Nov 14 2017 09:43
okay so how should I do it then ?
maybe I will write first what I want
I want to see all the rules, choose which I would like to use, and apply them...
thats it
Yaakov
@yaakov-h
Nov 14 2017 09:52
in VS, expand the References tab on your project, then Analysers, then StyleCop.Analyzers
kkrzysiek
@kkrzysiek
Nov 14 2017 09:53
and I see 2 DLL files.
Sam Harwell
@sharwell
Nov 14 2017 12:00
You can expand one of those DLL files
Then it has tiny little icons that show the current enabled state of each rule
Johan Larsson
@JohanLarsson
Nov 14 2017 12:04
We could make a gif showing how to configure and add it to the readme.
kkrzysiek
@kkrzysiek
Nov 14 2017 13:17
actually I cant do that
there is no option to expand this
and even if I could do that, can I simply remove the rule that I dont want ?
Sam Harwell
@sharwell
Nov 14 2017 13:53
You can disable it in a ruleset file
Once you get the ruleset file added to your project, it's pretty easy to do