Excluding code from Warning reports

I'd like to be able to exclude some code from R#r warning analysis/display.
Simple example being the generated InitializeComponent() code in a WinForm
app. Is this being considered? If so, can you provide a link.

I could see using a commenting syntax or maybe better yet a region naming
convention as a way to hint R#r ignore warning in a region.

In FxCop you can ignore specific rule violations, perhaps this approach
(after the fact) is usable?

/jhd


15 comments
Comment actions Permalink

AFAIK there is no such request yet. You may submit one.

--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

"John Dhom" <a@b.c> wrote in message news:c695nu$bnr$1@is.intellij.net...

I'd like to be able to exclude some code from R#r warning

analysis/display.

Simple example being the generated InitializeComponent() code in a WinForm
app. Is this being considered? If so, can you provide a link.

>

I could see using a commenting syntax or maybe better yet a region naming
convention as a way to hint R#r ignore warning in a region.

>

In FxCop you can ignore specific rule violations, perhaps this approach
(after the fact) is usable?

>

/jhd

>
>


0
Comment actions Permalink

I agree with John, there should be a method to limit warning
analysis/display. In my opinion this issue is mostly related to the
Windows/Component designer generated and untouchable code (lot of
"redundant cast" warnings). So, maybe, the best approach is to be able
to specify a set of region names to be excluded by the analysis.

giorgio


John Dhom wrote:

I'd like to be able to exclude some code from R#r warning analysis/display.
Simple example being the generated InitializeComponent() code in a WinForm
app. Is this being considered? If so, can you provide a link.

I could see using a commenting syntax or maybe better yet a region naming
convention as a way to hint R#r ignore warning in a region.

In FxCop you can ignore specific rule violations, perhaps this approach
(after the fact) is usable?

/jhd

0
Comment actions Permalink

Controlling it thru a region would be very convenient. If region info not
available what about metadata... like a class/method attribute...
[ReSharperIgnore("true")]

/jhd

"Giorgio Santini" <giorgio.santini@fastwebnet.it> wrote in message
news:c6d8qa$jf5$1@is.intellij.net...

I agree with John, there should be a method to limit warning
analysis/display. In my opinion this issue is mostly related to the
Windows/Component designer generated and untouchable code (lot of
"redundant cast" warnings). So, maybe, the best approach is to be able
to specify a set of region names to be excluded by the analysis.

>

giorgio

>
>

John Dhom wrote:

I'd like to be able to exclude some code from R#r warning

analysis/display.

Simple example being the generated InitializeComponent() code in a

WinForm

app. Is this being considered? If so, can you provide a link.

>

I could see using a commenting syntax or maybe better yet a region

naming

convention as a way to hint R#r ignore warning in a region.

>

In FxCop you can ignore specific rule violations, perhaps this approach
(after the fact) is usable?

>

/jhd

>
>



0
Comment actions Permalink

Hello John,

JD> Controlling it thru a region would be very convenient. If region
JD> info not available what about metadata... like a class/method
JD> attribute... [ReSharperIgnore("true")]

I think that using attributes for turning off warning detection is a great idea, and fits the spirit of the language much better than using regions. Regions have the purpose of logical grouping of methods, and overloading them with a different purpose doesn't look clean to me.

--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Dmitry,

But using attributes makes any project use some IDE-specific libraries
which isn't very good too. Additionally you can't turn off warning for an
arbitrary region, just for an entity which can be augmented with attributes.

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ega0$kqj$1@is.intellij.net...

Hello John,

>

JD> Controlling it thru a region would be very convenient. If region
JD> info not available what about metadata... like a class/method
JD> attribute... [ReSharperIgnore("true")]

>

I think that using attributes for turning off warning detection is a great

idea, and fits the spirit of the language much better than using regions.
Regions have the purpose of logical grouping of methods, and overloading
them with a different purpose doesn't look clean to me.
>

--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



0
Comment actions Permalink

So include the Attribute as a .dll file that must be mounted into the IDE so
it can work in any IDE?

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in message
news:c6ghek$1fl$1@is.intellij.net...

Dmitry,

>

But using attributes makes any project use some IDE-specific libraries
which isn't very good too. Additionally you can't turn off warning for an
arbitrary region, just for an entity which can be augmented with
attributes.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ega0$kqj$1@is.intellij.net...

>> Hello John,
>>
>> JD> Controlling it thru a region would be very convenient. If region
>> JD> info not available what about metadata... like a class/method
>> JD> attribute... [ReSharperIgnore("true")]
>>
>> I think that using attributes for turning off warning detection is a
>> great

idea, and fits the spirit of the language much better than using regions.
Regions have the purpose of logical grouping of methods, and overloading
them with a different purpose doesn't look clean to me.

>>
>> --
>> Dmitry Jemerov
>> OmniaMea Project Leader
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>



0
Comment actions Permalink

I think it's more important to be able to exclude entire types of warnings. I presume that ReSharper has a bunch of switches underneath the covers that mirror what IDEA has. So you could exclude unused parameters as a type of warning that you'd ever want to see. Excluding a specific warning instance, no matter how easy it is from the UI seems painful.

0
Comment actions Permalink

Derek,

To be perfectly honest, I thought about making code markup used by
ReSharper immediately in sources by using attributes. While having lots of
advantages there are several major drawbacks (one of them I mentioned). I'm
not sure that attaching a .dll to project is a good step. Let's discuss this
approach.

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Derek" <derek@btacinc.com> wrote in message
news:c6h9q3$3vk$1@is.intellij.net...

So include the Attribute as a .dll file that must be mounted into the IDE

so

it can work in any IDE?

>

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in message
news:c6ghek$1fl$1@is.intellij.net...

Dmitry,

>

But using attributes makes any project use some IDE-specific

libraries

which isn't very good too. Additionally you can't turn off warning for

an

arbitrary region, just for an entity which can be augmented with
attributes.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ega0$kqj$1@is.intellij.net...

>> Hello John,
>>
>> JD> Controlling it thru a region would be very convenient. If region
>> JD> info not available what about metadata... like a class/method
>> JD> attribute... [ReSharperIgnore("true")]
>>
>> I think that using attributes for turning off warning detection is a
>> great

idea, and fits the spirit of the language much better than using

regions.

Regions have the purpose of logical grouping of methods, and overloading
them with a different purpose doesn't look clean to me.

>>
>> --
>> Dmitry Jemerov
>> OmniaMea Project Leader
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>
>

>
>


0
Comment actions Permalink

Hello Dimitry,
I agree with your point, but up to now the only complain I have is that
I get lots of warning from IDE-generated code that I cannot change
manually. So I would be very happy to continue using the warning/error
analysis from Reshaper but not inside code generated by the IDE
designers. For example I find the "redundant cast" warning very useful
after refactoring, but it gives me some "false-positive" in Windows
Forms and User Control source files in the "Designer generated code" region

Ciao

Giorgio

Dmitry Jemerov (JetBrains) wrote:

Hello John,

JD> Controlling it thru a region would be very convenient. If region
JD> info not available what about metadata... like a class/method
JD> attribute... [ReSharperIgnore("true")]

I think that using attributes for turning off warning detection is a great idea, and fits the spirit of the language much better than using regions. Regions have the purpose of logical grouping of methods, and overloading them with a different purpose doesn't look clean to me.

0
Comment actions Permalink

Hello Oleg,

OS> To be perfectly honest, I thought about making code markup used
OS> by ReSharper immediately in sources by using attributes. While
OS> having lots of advantages there are several major drawbacks (one of
OS> them I mentioned). I'm not sure that attaching a .dll to project is
OS> a good step. Let's discuss this approach.

One simple solution is the following: Let me define my own attribute (or several attributes) for exclusion and specify their full-qualified names in the Resharper options. I think it would be a much smaller inconvenience than having to attach to an IDE-provided DLL.

--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

If the "regions" are defined in source seems they need to be comment-based
(possibly extension of #region)... to satisfy ide/non-ide and R#r/non-R#r
environments issue.

Selection approach... Consider using the standard selection mechanism to
define "IgnoreWarnings", or other, "regions". Select the "region", use
context menuitem "R#r IgnoreWarnings". Defined "regions" would be maintained
outside the source code.

Couple questions that come to mind are 1) scope of "region" definitions
(workstation, shared)? 2) Display/navigate defined "regions".

BTW, I find the idea of Displaying/navigating (next/prev) these "regions" or
more generally #region to be attractive... It'd be very useful to see a list
of #regions by file/project/solution. Hotkey navigation between regions
(extension to alt+up/down) would be nice too. This idea resonate with anyone
else?

/jhd

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in message
news:c6iar4$fl4$1@is.intellij.net...

Derek,

>

To be perfectly honest, I thought about making code markup used by
ReSharper immediately in sources by using attributes. While having lots of
advantages there are several major drawbacks (one of them I mentioned).

I'm

not sure that attaching a .dll to project is a good step. Let's discuss

this

approach.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Derek" <derek@btacinc.com> wrote in message
news:c6h9q3$3vk$1@is.intellij.net...

So include the Attribute as a .dll file that must be mounted into the

IDE

so

it can work in any IDE?

>

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in

message

news:c6ghek$1fl$1@is.intellij.net...

Dmitry,

>

But using attributes makes any project use some IDE-specific

libraries

which isn't very good too. Additionally you can't turn off warning for

an

arbitrary region, just for an entity which can be augmented with
attributes.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ega0$kqj$1@is.intellij.net...

>> Hello John,
>>
>> JD> Controlling it thru a region would be very convenient. If region
>> JD> info not available what about metadata... like a class/method
>> JD> attribute... [ReSharperIgnore("true")]
>>
>> I think that using attributes for turning off warning detection is a
>> great

idea, and fits the spirit of the language much better than using

regions.

Regions have the purpose of logical grouping of methods, and

overloading

them with a different purpose doesn't look clean to me.

>>
>> --
>> Dmitry Jemerov
>> OmniaMea Project Leader
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>
>

>
>

>
>


0
Comment actions Permalink

Another take on using #regions...

What about using existing #regions to build a picklist? Allowing user to
select the #region(s) to apply settings (i.e. IgnoreWarnings).

Per previous post I like the idea of #region navigation. Jumping to #regions
like alt+up/down does for methods. A summary display of #regions (like find
results) would be sweet too.

/jhd

"John Dhom" <a@b.c> wrote in message news:c6ee0d$84o$1@is.intellij.net...

Controlling it thru a region would be very convenient. If region info not
available what about metadata... like a class/method attribute...
[ReSharperIgnore("true")]

>

/jhd

>

"Giorgio Santini" <giorgio.santini@fastwebnet.it> wrote in message
news:c6d8qa$jf5$1@is.intellij.net...

I agree with John, there should be a method to limit warning
analysis/display. In my opinion this issue is mostly related to the
Windows/Component designer generated and untouchable code (lot of
"redundant cast" warnings). So, maybe, the best approach is to be able
to specify a set of region names to be excluded by the analysis.

>

giorgio

>
>

John Dhom wrote:

I'd like to be able to exclude some code from R#r warning

analysis/display.

Simple example being the generated InitializeComponent() code in a

WinForm

app. Is this being considered? If so, can you provide a link.

>

I could see using a commenting syntax or maybe better yet a region

naming

convention as a way to hint R#r ignore warning in a region.

>

In FxCop you can ignore specific rule violations, perhaps this

approach

(after the fact) is usable?

>

/jhd

>
>

>
>


0
Comment actions Permalink

Not sure if keeping regions out of the sources is a good idea. What happens
when one modifies the file externally? Additionally it makes generators (I
think that generated code it the main source of warnings) more difficult to
write since they have to generate source code plus region data.

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"John Dhom" <a@b.c> wrote in message news:c6j58j$kpn$1@is.intellij.net...

If the "regions" are defined in source seems they need to be comment-based
(possibly extension of #region)... to satisfy ide/non-ide and R#r/non-R#r
environments issue.

>

Selection approach... Consider using the standard selection mechanism to
define "IgnoreWarnings", or other, "regions". Select the "region", use
context menuitem "R#r IgnoreWarnings". Defined "regions" would be

maintained

outside the source code.

>

Couple questions that come to mind are 1) scope of "region" definitions
(workstation, shared)? 2) Display/navigate defined "regions".

>

BTW, I find the idea of Displaying/navigating (next/prev) these "regions"

or

more generally #region to be attractive... It'd be very useful to see a

list

of #regions by file/project/solution. Hotkey navigation between regions
(extension to alt+up/down) would be nice too. This idea resonate with

anyone

else?

>

/jhd

>

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in message
news:c6iar4$fl4$1@is.intellij.net...

Derek,

>

To be perfectly honest, I thought about making code markup used by
ReSharper immediately in sources by using attributes. While having lots

of

advantages there are several major drawbacks (one of them I mentioned).

I'm

not sure that attaching a .dll to project is a good step. Let's discuss

this

approach.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Derek" <derek@btacinc.com> wrote in message
news:c6h9q3$3vk$1@is.intellij.net...

So include the Attribute as a .dll file that must be mounted into the

IDE

so

it can work in any IDE?

>

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in

message

news:c6ghek$1fl$1@is.intellij.net...

Dmitry,

>

But using attributes makes any project use some IDE-specific

libraries

which isn't very good too. Additionally you can't turn off warning

for

an

arbitrary region, just for an entity which can be augmented with
attributes.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ega0$kqj$1@is.intellij.net...

>> Hello John,
>>
>> JD> Controlling it thru a region would be very convenient. If

region

>> JD> info not available what about metadata... like a class/method
>> JD> attribute... [ReSharperIgnore("true")]
>>
>> I think that using attributes for turning off warning detection is

a

>> great

idea, and fits the spirit of the language much better than using

regions.

Regions have the purpose of logical grouping of methods, and

overloading

them with a different purpose doesn't look clean to me.

>>
>> --
>> Dmitry Jemerov
>> OmniaMea Project Leader
>> JetBrains, Inc.
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>
>

>
>

>
>

>
>


0
Comment actions Permalink

I like the idea of IDE support for custom attributes. I'll think how this
paradigm can be extended.

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ij0b$5p9$1@is.intellij.net...

Hello Oleg,

>

OS> To be perfectly honest, I thought about making code markup used
OS> by ReSharper immediately in sources by using attributes. While
OS> having lots of advantages there are several major drawbacks (one of
OS> them I mentioned). I'm not sure that attaching a .dll to project is
OS> a good step. Let's discuss this approach.

>

One simple solution is the following: Let me define my own attribute (or

several attributes) for exclusion and specify their full-qualified names in
the Resharper options. I think it would be a much smaller inconvenience than
having to attach to an IDE-provided DLL.
>

--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



0
Comment actions Permalink

And I think that we shouldn't be bound by attributes. A good example is
having warnings disabled automatically for InitializeComponents methods in
Windows Forms.

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Jemerov (JetBrains)" <yole@jetbrains.com> wrote in message
news:c6ij0b$5p9$1@is.intellij.net...

Hello Oleg,

>

OS> To be perfectly honest, I thought about making code markup used
OS> by ReSharper immediately in sources by using attributes. While
OS> having lots of advantages there are several major drawbacks (one of
OS> them I mentioned). I'm not sure that attaching a .dll to project is
OS> a good step. Let's discuss this approach.

>

One simple solution is the following: Let me define my own attribute (or

several attributes) for exclusion and specify their full-qualified names in
the Resharper options. I think it would be a much smaller inconvenience than
having to attach to an IDE-provided DLL.
>

--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



0

Please sign in to leave a comment.