StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
75 stars 31 forks source link

LC0016 - ignores ShowCaption property #579

Closed sit-zm closed 4 months ago

sit-zm commented 6 months ago

LC0016 warning is shown even if ShowCaption = false for the group property on page.

image

Best, Zoran M.

Arthurvdv commented 6 months ago

There's already an check in place for the ShowCaption property, so the rule shouldn't be raised.

I'm having trouble to reproduce this, because with the examples below the LC0016 diagnostic isn't raised.

Can you provide a small code sample to reproduce this bug?

page 50100 MyPage
{
    Caption = 'MyPage';

    layout
    {
        area(Content)
        {
            group(MyGroup)
            {
                ShowCaption = false;
            }
        }
    }
}

pageextension 50100 "Customer Card" extends "Customer Card"
{
    layout
    {
        addafter(General)
        {
            group(MyGroup)
            {
                ShowCaption = false;
            }

        }
    }
}
sit-zm commented 6 months ago

Hi Arthur,

The sample is below. You can test it out.

pageextension 50000 DYCEMyExtension extends "Warehouse Shipment"
{
    layout
    {
        addlast(Shipping)
        {
            group("DYCEShippingTo")
            {
                Caption = 'Shipping To';

                field("DYCE Ship-To"; Rec."Assigned User ID")
                {
                    ApplicationArea = All;
                    Caption = 'Ship-to';
                    ToolTip = 'Specifies the address that the products on the sales document are shipped to. Default (Sell-to Address): The same as the customer''s sell-to address. Alternate Ship-to Address: One of the customer''s alternate ship-to addresses. Custom Address: Any ship-to address that you specify in the fields below.';
                }
                group(DYCEShipToFields)
                {
                    ShowCaption = false;
                }
            }
        }
    }
}

image

DYCE is mandatory prefix but that does not change the issue.

Best, Zoran M.

pri-kise commented 5 months ago

I don't receive the warning LC0016 in my local deveopment environment (preview version), but I receive it in our pipelines e.g. for CueGroup

Arthurvdv commented 4 months ago

I'm having trouble to reproduce this. A copy of your example doesn't thrown an warning for me 🤔

image

Can you very you have the latest LinterCop.dll (0.30.19.0) version?

%userprofile%.vscode\extensions\ms-dynamics-smb.al-13.0.1007491\bin\Analyzers

image

sit-zm commented 4 months ago

Now it works OK.

I have the latest version BusinessCentral.LinterCop.dll image image image