New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naming of Dotnet variables Business Central AL Language Source Control #6457
Comments
This might explain what #6422 was trying to determine, i.e. what the AA0072 CodeCop currently considers a "valid" name for .Net objects. |
The only way to bypass the warning at the moment is by using the name of the assembly, it seems that the code analyzers don't use the alias as the expected name. There is an extended example:
I understand this is a bug, it is not critical but it should be corrected |
Thanks for that info. I'd propose that #6422 be closed as a dupe of this, since this thread got the answer on what the current preferred naming rule is and what it should be instead. |
In that case I would just |
Hello dnpb, can you please write a code sample, how to use #pragma to suppress the warning in a special region? Thanks |
#pragma warning disable AA0072
// code for which you don't want / care about warnings here
#pragma warning restore AA0072 |
Thanks for reporting this issue. Sorry we haven’t completed it yet, but we’ve had to prioritize elsewhere. We’re planning to give the CodeCop engine and its rules an overhaul in a future major release. Thanks for your patience. For this case consider using Pragma Warning Directive. |
The naming of DotNet Variables on prem is very strange
example:
MyDateTime: DotNet MyDateTime; //AL(AA0072) Warning
"System.DateTime": DotNet MyDateTime; //Not warning
As it seems wrong to me to declare the variable in this way ("System.DateTime"), I would give it the same name as the alias (MyDateTime).
The text was updated successfully, but these errors were encountered: