[Column("address_book_id")] public int AddressBookID { get { return _AddressBookID; } set { _AddressBookID = value; MarkColumnModified("address_book_id"); } } int _AddressBookID;
Now I could easily add a new rule to allow an underscore and then PascalCase for private fields, but that is not what I really want as I don't want that type of variable naming anywhere else in the code. I will allow it for the T4 generated code, but not in normal code.
I noticed it is possible to ignore a particular error in a file and the warnings all go away, but as far as I can tell this is not stored anywhere in the project or solution file, so the next developer who loads the project (or myself when I get to work) is going to have to do the same ignore command. So is there a way to tell it to ignore this for that particular file only, and somehow store it in the project (or a pragma or something in the source file) so all the programmers don't have to do the same thing?
If not I guess my only option is to fix the T4 templates to generate cleaner code, which I suppose I could do but I know I will run into this again somewhere else.
7 Answers, 1 is accepted
Sorry, perhaps this is a bit late, but you are correct, the Analysis and styling functions cannot be overridden like that.
--
Stuart
Thanks for contacting us.
If you have installed the latest JustCode internal build you will have the QuickFix command like in this demo. This way you could ignore errors / warnings and store them in the .JustCode folder in your solution.
I hope this will help you.
Thanks.
Zdravko
the Telerik team
Also it would be nice to be able to ignore a single warning in a file, or a single warning class, rather than having to ignore all warnings in a file. The XML in the .JustCode directory clearly indicates each warning is tagged separately, but you have to ignore them in an entire block for the entire file?
Thanks for the reply.
If you take a look at the QuickFixes pop up Visual aid menu you will find there that you can ignore only a single warning and also the function to "Find all such problems" and then ignore only them.
I hope this will help you.
Thanks.
Zdravko
the Telerik team
However I still believe the warning ignoring options should be stored in the .csproj file, not in a separate .JustCode XML file as if we have a legit reason to ignore warnings on a particular item it should be the same for ALL developers on our team, not just me. For them to have to also re-ignore the same warnings (or for me to do it once at home on my laptop and once at work on my desktop) just seems wrong.
For instance there are some warnings that I agree with 100%, for NORMAL code. Such as the class name needing to be the same as the file it is contained within. However in some instances we need to violate that concept, and we do it knowingly. A great example is the API interface file for our WCF services. We store ALL the DTO classes, ALL the DTO enumerations and the public WCF contract interface that defines our WCF contract in one single file, rather than splitting it up across multiple files. The primary reason for doing this is so that we can version the WCF contract file in one place, and we use the current source control revision number (we use Perforce) in our build system to define the API contract version. That way we have completely decoupled our client and server code to the point that we don't need to rebuild and re-deploy client code if it never changed, when we rebuild the server. We only have to do that if the WCF contract has been changed (and we enforce that when the client starts up, by checking the version it was compiled against when connecting to the server).
So the catch is we have legit reasons to want to ignore warnings in certain files for certain classes for ALL our developers, and not have them need to do the same when they load a project the first time. Yet we don't want to turn off this option across the board because for the rest of our code, we follow the rules.
Hence I need some way to preserve these warning settings that can be checked into source control, and given that the .JustCode directory is hidden, along with the file in it, it was clearly not intended to be stored in version control.
Thank for the reply.
We will consider your suggestion within the team.
However, you can include the .JustCode folder to your version control so all users that use the source will have ignored the same errors.
You can also add the file name to Exclude File Filters text box and no warning / errors will be shown from it. It is located at JustCode menu > Options > Code Analysis. Beware that every file containing the name will be ignored too.
Thanks for helping us to improve JustCode.
Zdravko
the Telerik team