Skip to content
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

AS0011 does not trigger for enum if namespace is set #7987

Open
navdotnetreqs opened this issue Mar 1, 2025 · 2 comments
Open

AS0011 does not trigger for enum if namespace is set #7987

navdotnetreqs opened this issue Mar 1, 2025 · 2 comments
Labels
accepted AppSourceCop This is a specific static-code-analysis group (AS)

Comments

@navdotnetreqs
Copy link

navdotnetreqs commented Mar 1, 2025

1. Describe the bug
AS001 does not give a warning about mandatory affix for Enum object, if a namespace is defined

2. To Reproduce
Steps to reproduce the behavior:

  • Enable AppSourceCop
  • Define affix in AppSourceCop.json
  • Create file
namespace fuu.bar;
enum 12345 "Status Enum"
{
    Access = Internal;
    value(0; "")
    {
    }
    value(1; Unknown)
    {
        Caption = 'Unknown';
    }
    value(2; InProgress)
    {
        Caption = 'InProgress';
    }
}

Remove namespace, and it triggers. Leave it in, and it does not.

3. Expected behavior

AS0011 should give a warning, such as:
The identifier 'Deployment Status Enum' must have at least one of the mandatory affixes 'ABCD'

Just as it does for other objects. As far as I know, there has not been a change in policy for requiring affixes even if namespaces are used? If such a change exists, this must be reflected across all objects.

4. Actual behavior
AS0011 does not give a warning.

5. Versions:

  • AL Language:
  • 15.0.1338262
  • Visual Studio Code:
  • 1.96 insider
    Internal work item: AB#567903
@navdotnetreqs
Copy link
Author

This was supposed to be fixed in 2021 ? #6676

Also related to more recent #7675 where it is stated that affixes are mandatory despite using namespaces.

@nndobrev
Copy link
Contributor

nndobrev commented Mar 3, 2025

@navdotnetreqs I am afraid it is not the same as #6676 as we didn't have namespaces back in 2021. I am accepting it for further investigation.

@nndobrev nndobrev added AppSourceCop This is a specific static-code-analysis group (AS) accepted labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted AppSourceCop This is a specific static-code-analysis group (AS)
Projects
None yet
Development

No branches or pull requests

2 participants