History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-40358
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Ilya Ryzhenkov
Reporter: Drew Noakes
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

User attribute enables warning on custom method parameters with same semantics as string.Format(...)

Created: 11 May 07 19:38   Updated: 11 May 07 20:01
Component/s: Code Analysis
Fix Version/s: Mirabilie Futurum
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 376


 Description  « Hide
Imagine a logging framework method:

public void Log(LogLevel level, string message, params object[] formatItems)
{
Log(level, string.Format(message, formatItems);
}

I'd like to define my own attribute (much as NullableAttribute is supported) that specifies my method should receive the same analysis that string.Format() receives.

[StringFormatAnalysis]
public void Log(LogLevel level, string message, params object[] formatItems)
{
Log(level, string.Format(message, formatItems);
}

So calls like this would indicate warnings:

Log(LogLevel.Info, "Doing {0} {1} times", action);

Log(LogLevel.Info, "Entering {0}.", location, size);



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.