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

customCodeCops for BusinessCentral.LinterCop does not seem to work #788

Closed
BertDeTemmerman opened this issue Oct 24, 2023 · 7 comments
Closed
Labels
bug Something isn't working Fix Ready Fix Ready

Comments

@BertDeTemmerman
Copy link

I have added the setting customCodeCops to my AL-Go-Settings.json:

  "customCodeCops": [
    "https://github.com/StefanMaron/BusinessCentral.LinterCop/releases/download/v0.30.0/BusinessCentral.LinterCop.current.dll"
  ],

(similar to Stefan Maron is using here)

On a seperate branch, I've removed a caption from an action, so the BCLinterCop givess the warning.

BCLinterCop active

If I commit this and create a PR, the pipeline triggers.
But it doesn't seem to use the BCLinterCop.

.\alc.exe /project:"c:\sources\App" /packagecachepath:"c:\sources\.packages" /out:"c:\sources\.output\ESC bv_Calculation_21.0.2147483647.0.app" /analyzer:C:\build\vsix\extension\bin\Analyzers\Microsoft.Dynamics.Nav.CodeCop.dll /analyzer:C:\build\vsix\extension\bin\Analyzers\Microsoft.Dynamics.Nav.AppSourceCop.dll /analyzer:C:\build\vsix\extension\bin\Analyzers\Microsoft.Dynamics.Nav.UICop.dll /ruleset:c:\shared\.github\.vscode\module.ruleset.json /enableexternalrulesets /SourceRepositoryUrl:"https://github.com/ESCbv/TestALGOAppSource2" /SourceCommit:"709c6ede636df90d80624c325e73a840e1d25ca9" /BuildBy:"AL-Go for GitHub,v4.0" /BuildUrl:"https://github.com/ESCbv/TestALGOAppSource2/actions/runs/6625078712" /assemblyprobingpaths:"C:\Program Files\dotnet\shared","C:\ProgramData\BcContainerHelper\Extensions\bcCalculation6625078712\.netPackages\Service"

Other warnings are given

  Warning: AL0749 The type 'CalculationHeader' of the parameter 'Calculation Header ESCA' of the public method 'RecalculateCalculationPrices' has 'Internal' accessibility. The method will not be callable outside of this module without an implicit conversion.
  Warning: AL0603 An implicit conversion is being performed from a value of type 'Enum Microsoft.Foundation.Enums."Unit Cost Calculation Type"' to a value of type 'Integer'. This conversion can lead to unexpected runtime issues. This warning will become an error in a future release.
  c:\sources\App\src\codeunit\CalculationEventMgt.codeunit.al(146,9): info AA0210: The table Calculation Line ESCA does not contain a key with the field Status.

What am I missing to make customCodeCops work?
Thanks in advance.

@freddydk
Copy link
Contributor

Your setting looks correct.
If you include the full log, I will be be able to see whether this is because the setting isn't read and which version you are running etc. etc.

@freddydk freddydk added the Need more info Please add more info about how to repro the problem label Oct 24, 2023
@BertDeTemmerman
Copy link
Author

Sorry for the delay.

The full logs:
logs_44 (1).zip

@cegekaJG
Copy link
Contributor

I'm experiencing the same problem. Here's my log, starting from the beginning of the Run Pipeline step, and ending after listing the parameters.

As you can see, I've provided a URL for the customCodeCop property, but when listing the parameters, the array is empty. There's no log about whether the download succeeded, or was even attempted.

@freddydk freddydk added Under Investigation Issue is under investigation and removed Need more info Please add more info about how to repro the problem labels Jan 24, 2024
@cegekaJG
Copy link
Contributor

cegekaJG commented Mar 8, 2024

Is there any progress with this? We're starting to have problems with checks that succeed when they should fail.

@freddydk
Copy link
Contributor

freddydk commented Mar 8, 2024

We have been caught up with BC 24 issues, so unfortunately nothing yet.

@dsaveyn
Copy link

dsaveyn commented Apr 12, 2024

@freddydk any timeline on this? It's a bit annoying our custom codecops are not executed.

@freddydk
Copy link
Contributor

freddydk commented Apr 14, 2024

The reason for this is, that despite the documentation saying so, CustomCodeCops cannot be a URL today.
The fix for this is in BcContainerHelper and in a PR here: microsoft/navcontainerhelper#3488

When that has merged, you would need to add "vsixFile": "latest" to your settings file as well as the Lintercop from @StefanMaron requires the latest AL Language Exrension.

You can see a test run with the Lintercop here: https://github.com/BusinessCentralApps/buildorder/actions/runs/8679462223

@freddydk freddydk added bug Something isn't working In Progress Issue is actively being worked on and removed Under Investigation Issue is under investigation labels Apr 14, 2024
@freddydk freddydk added Fix Ready Fix Ready and removed In Progress Issue is actively being worked on labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fix Ready Fix Ready
Projects
None yet
Development

No branches or pull requests

4 participants