diff --git a/.AL-Go/settings.json b/.AL-Go/settings.json index afc78d3..1880f08 100644 --- a/.AL-Go/settings.json +++ b/.AL-Go/settings.json @@ -1,6 +1,8 @@ { - "country": "us", + "country": "at", "appFolders": [], "testFolders": [], - "bcptTestFolders": [] + "bcptTestFolders": [], + "installApps":[], + "appDependecyProbingPaths":[] } diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index 17ac5bb..2a292d1 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -1,4 +1,12 @@ { + "doNotPublishApps": true, + "enableCodeCop": true, + "enablePerTenantExtensionCop": false, + "enableUICop": true, + "githubRunner": "ubuntu-latest", + "runs-on": "ubuntu-latest", + "skipUpgrade": true, + "templateUrl": "https://github.com/CBS-BC-AT/AL-Go@main", "type": "PTE", - "templateUrl": "https://github.com/microsoft/AL-Go-PTE@main" + "useCompilerFolder": true } diff --git a/.github/Test Current.settings.json b/.github/Test Current.settings.json index afb3d65..5ccf819 100644 --- a/.github/Test Current.settings.json +++ b/.github/Test Current.settings.json @@ -1,5 +1,6 @@ { "artifact": "////latest", "cacheImageName": "", - "versioningStrategy": 15 + "versioningStrategy": 15, + "doNotRunBcptTests": false } diff --git a/.github/Test Next Major.settings.json b/.github/Test Next Major.settings.json index 1fc329d..4783c5c 100644 --- a/.github/Test Next Major.settings.json +++ b/.github/Test Next Major.settings.json @@ -1,5 +1,6 @@ { "artifact": "////nextmajor", "cacheImageName": "", - "versioningStrategy": 15 + "versioningStrategy": 15, + "doNotRunBcptTests": false } diff --git a/.github/Test Next Minor.settings.json b/.github/Test Next Minor.settings.json index 127bce7..ef8bed9 100644 --- a/.github/Test Next Minor.settings.json +++ b/.github/Test Next Minor.settings.json @@ -1,5 +1,6 @@ { "artifact": "////nextminor", "cacheImageName": "", - "versioningStrategy": 15 + "versioningStrategy": 15, + "doNotRunBcptTests": false } diff --git a/.gitignore b/.gitignore index 9b1f2f8..da3ef57 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ Thumbs.db TestResults*.xml bcptTestResults*.json BuildOutput.txt +launch.json rad.json .output/ .dependencies/ @@ -15,6 +16,9 @@ rad.json .packages/ .alcache/ .altemplates/ +.altestrunner .snapshots/ cache_* ~$* + +!dependencies/**/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9285240 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-json + - id: check-xml + - id: check-yaml + - id: check-merge-conflict + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + - id: mixed-line-ending + - id: sort-simple-yaml diff --git a/CegekaAT.ruleset.json b/CegekaAT.ruleset.json new file mode 100644 index 0000000..9f2f5d7 --- /dev/null +++ b/CegekaAT.ruleset.json @@ -0,0 +1,11 @@ +{ + "name": "Cegeka AT Ruleset", + "description": "Standard ruleset defined by Cegeka AT", + "rules": [ + { + "id": "AA0072", + "action": "None", + "justification": "Extensive naming pattern is intrusive and unnecessary when working with VS Code." + } + ] +} diff --git a/al.code-workspace b/al.code-workspace index 0cd1af6..936d4b7 100644 --- a/al.code-workspace +++ b/al.code-workspace @@ -1,8 +1,75 @@ { - "folders": [ - { - "path": ".AL-Go" - } + "folders": [ + { + "path": ".AL-Go" + }, + { + "path": "dependencies" + }, + { + "path": "resources" + }, + { + "path": "scripts" + } + ], + "settings": { + "al.assemblyProbingPaths": [ + "./.netpackages", + "C:/Windows/assembly/" ], - "settings": {} + "al.backgroundCodeAnalysis": false, + "al.codeAnalyzers": [ + "${CodeCop}", + "${UICop}", + "${analyzerFolder}BusinessCentral.LinterCop.dll" + ], + "al.enableCodeActions": true, + "al.enableCodeAnalysis": true, + "al.enableExternalRulesets": true, + "al.ruleSetPath": "../CegekaAT.ruleset.json", + "alOutline.addDataItemToReportColumnName": true, + "alOutline.addToolTipsToPageFields": true, + "alOutline.codeCleanupActions": [ + "AddApplicationAreas", + "AddMissingParentheses", + "ConvertObjectIdsToNames", + "FixIdentifiersCase", + "FixKeywordsCase", + "MakeFlowFieldsReadOnly", + "RemoveEmptyTriggers", + "RemoveEmptySections", + "RemoveStrSubstNoFromError", + "RemoveWithStatements", + "RemoveUnusedVariables", + "RemoveEmptyLines", + "SortVariables", + "TrimTrailingWhitespace", + "FormatDocument" + ], + "alOutline.fixCaseRemovesQuotesFromDataTypeIdentifiers": true, + "alOutline.fixCodeCopMissingParenthesesOnSave": true, + "alOutline.idReservationProvider": "ALObjectIdNinja", + "alOutline.openDefinitionInNewTab": true, + "CRS.ExtensionObjectNamePattern": "", + "CRS.FileNamePattern": "..al", + "CRS.FileNamePatternExtensions": "..al", + "CRS.FileNamePatternPageCustomizations": "..al", + "CRS.ObjectNamePrefix": "", + "CRS.ObjectNameSuffix": "", + "CRS.RenameWithGit": false, + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "modifications", + "files.autoSave": "afterDelay", + "files.trimTrailingWhitespace": true, + "githubPullRequests.assignCreated": "${user}", + "githubPullRequests.defaultMergeMethod": "squash", + "githubPullRequests.pullBranch": "always", + "githubPullRequests.pushBranch": "always", + "gitlens.advanced.blame.customArguments": [ + "-CCC" + ], + "gitlens.advanced.fileHistoryFollowsRenames": true, + "gitlens.blame.ignoreWhitespace": true + } } diff --git a/dependencies/Place Dependencies here.txt b/dependencies/Place Dependencies here.txt new file mode 100644 index 0000000..7d0ea6a --- /dev/null +++ b/dependencies/Place Dependencies here.txt @@ -0,0 +1,8 @@ +Place any artifacts the project is dependent on here, such as: + +- BC extension apps +... + +When adding a new app required to publish this project, ensure +that the relative path to the app or parent folder is included +in the array "installApps" in `.AL-Go\settings.json`. diff --git a/resources/CodeCop.tsv b/resources/CodeCop.tsv new file mode 100644 index 0000000..b56467d --- /dev/null +++ b/resources/CodeCop.tsv @@ -0,0 +1,81 @@ +Id Title Category Default Severity New Severity +AA0001 There must be exactly one space character on each side of a binary operator such as := + - AND OR =. Readability Warning +AA0002 There must be no space character. Readability Warning +AA0003 There must be exactly one space character between the NOT operator and its argument. Readability Warning +AA0005 Only use BEGIN..END to enclose compound statements. Readability Warning +AA0008 Function calls should have parenthesis even if they do not have any parameters. Readability Warning +AA0013 When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character. Readability Warning +AA0018 The END, IF, REPEAT, UNTIL, FOR, WHILE, and CASE statement should always start a line. Readability Warning +AA0021 Variable declarations should be ordered by type. Readability Warning +AA0022 Substitute the IF THEN ELSE structure with a CASE. Readability Warning +AA0040 Avoid using nested WITH statements. Readability Warning +AA0050 Permission set extensions should not include permissions for objects defined in another application. Design Warning +AA0051 Permission set extensions should not include permission sets defined in another application. Design Warning +AA0052 Permission set extensions should not include permission sets which include permissions for objects defined in another application. Design Warning +AA0053 Permission set extensions should not include wildcard permissions. Design Warning +AA0072 The name of variables and parameters must be suffixed with the type or object name. Readability Info +AA0073 The name of temporary variable must be prefixed with Temp. Readability Warning +AA0074 TextConst and Label variable names should have an approved suffix. Readability Warning +AA0087 Lowering permissions should only be used in tests Design Warning +AA0100 Do not have identifiers with quotes in the name. Design Warning +AA0101 Use camel case property values in pages of type API. Design Warning +AA0102 Use camel case name for field controls in pages of type API. Design Warning +AA0103 Use camel case property values in queries of type API. Design Warning +AA0104 Use camel case name for column controls in queries of type API. Design Warning +AA0105 PagePart controls must not refer to parent pages. Design Error +AA0106 A page of type API can only refer to the same subpage once. Design Error +AA0131 String parameters must match placeholders. Design Warning +AA0136 Do not write code that will never be hit. Design Warning +AA0137 Do not declare variables that are unused. Design Warning +AA0139 Do not assign a text to a target with smaller size. Design Warning +AA0150 Do not declare parameters by reference if their values are never changed. Design Warning +AA0161 Only use AssertError in Test Codeunits. Design Warning +AA0175 Only find record if you need to use it. Design Warning +AA0181 The FindSet() or Find() methods must be used only in connection with the Next() method. Design Warning +AA0189 Only use a correct values of ApplicationArea. Design Warning +AA0194 Only write actions that have an effect. Design Warning +AA0198 Do not use identical names for local and global variables. Design Warning +AA0199 Use only a correct order for ApplicationArea. Design Warning +AA0200 When ApplicationArea is set to 'All', no other values for ApplicationArea should be specified. Design Warning +AA0201 When ApplicationArea is set to 'Basic', you must also specify 'Suite'. Design Warning +AA0202 To avoid confusion, do not give local variables the same name as fields, methods, or actions in the same scope. Design Warning +AA0203 To avoid confusion, do not give methods the same name as fields or actions in the same scope. Design Warning +AA0204 To avoid confusion, do not give global variables the same name as fields, methods, or actions in the same scope. Design Warning +AA0205 Variables must be initialized before usage. Design Warning +AA0206 The value assigned to a variable must be used. Design Warning +AA0207 The EventSubscriber method must be local. Design Warning +AA0210 Avoid non-indexed fields into filtering. Design Info +AA0211 Avoids a runtime error from using CalcFields on a field that is not a FlowField or a field of type Blob. Design Warning +AA0213 Obsoleted object must have a state 'Pending' or 'Removed' and a justification specifying why this field is being obsoleted. Design Warning +AA0214 The local record should be modified before saving to the database. Design Warning +AA0215 Follow the style guide about the best practices for naming. Readability Warning +AA0216 Use a text constant for passing user messages and errors without concatenations. Localizability Warning +AA0217 Use a text constant or label for format string in StrSubstNo. Localizability Warning +AA0218 You must write a tooltip in the Tooltip property for all controls of type Action and Field that exist on page objects. Localizability Warning +AA0219 The Tooltip property of Fields must start with 'Specifies'. Localizability Warning +AA0220 The value of the Tooltip property of Fields must be filled. Localizability Warning +AA0221 You must specify a OptionCaption property for all fields which source expressions is not a table field. Localizability Warning +AA0222 SIFT index should not be used on primary or unique key. Design Warning +AA0223 The value of the OptionCaption property of Fields must be filled in. Localizability Warning +AA0224 The count of option captions specified in the OptionCaption property is wrong. Localizability Warning +AA0225 You must specify a caption in the Caption property for Fields that exist on page objects. Localizability Warning +AA0226 The value of the Caption property of Fields must be filled in. Localizability Warning +AA0227 Optional return value should not be omitted in upgrade codeunits. Design Warning +AA0228 The local method must be used; otherwise removed. Design Warning +AA0230 Version should not be specified for internal assemblies. Design Warning +AA0231 StrSubstNo or string concatenation must not be used as a parameter in the Error method. Design Warning +AA0232 The FlowField of a table should be indexed. Design Info +AA0233 Use Get(), FindFirst() and FindLast() without Next() method. Design Warning +AA0235 When using 'OnInstallAppPerCompany' you should also add 'Company-Initialize'::'OnCompanyInitialize' event subscriber. Design Info +AA0237 The name of non-temporary variables must not be prefixed with Temp. Readability Warning +AA0240 Email and Phone No must not be present in any part of the source code. Design Warning +AA0241 Use all lowercase letters for reserved language keywords. Readability Hidden +AA0242 Limit JIT loads by selecting all fields for load. Design Warning +AA0243 Running an upgrade codeunit is not allowed. Design Warning +AA0244 Do not use identical names for parameters and global variables. Design Warning +AA0245 To avoid confusion, do not give parameters the same name as fields, methods, or actions in the same scope. Design Warning +AA0246 Suppressing all diagnostics is not allowed. Design Warning +AA0247 Use namespaces. Design Info +AA0448 You must use the FieldCaption method instead of the FieldName method and TableCaption method instead of TableName method. Localizability Warning +AA0462 The CalcDate should only be used with DataFormula variables. Alternatively the string should be enclosed using the <> symbols. Localizability Warning +AA0470 Placeholders should have a comment explaining their content. Localizability Warning diff --git a/resources/LinterCop.tsv b/resources/LinterCop.tsv new file mode 100644 index 0000000..30d2901 --- /dev/null +++ b/resources/LinterCop.tsv @@ -0,0 +1,52 @@ +Id Title Default Severity New Severity +LC0000 There was an error in a Linter Rule Info +LC0001 FlowFields should not be editable. Warning +LC0002 Commit() needs a comment to justify its existence. Either a leading or a trailing comment. Warning +LC0003 Do not use an Object ID for properties or variables declaration. Use {1} instead. Warning +LC0004 "Property ""LookupPageID"" and ""DrilldownPageID"" must be filled in table because it is used in list page" Warning +LC0005 Wrong casing detected! Warning +LC0006 AutoIncrement fields are not possible in temporary tables! Error +LC0007 DataPerCompany is missing! Hidden +LC0008 Filter operators should not be used in SetRange. Use SetFilter instead. Warning +LC0009 Cyclomatic complexity and Maintainability index Info +LC0010 Cyclomatic complexity and Maintainability index Warning +LC0011 Access property is missing! Hidden +LC0012 Wrong Parameter detected. Warning +LC0013 NotBlank should be set explicitly for tables with a single-field primary key. Warning +LC0014 The Caption of permissionset objects should not exceed the maximum length. Warning +LC0015 All application objects should be covered by at least one permission set in the extension. Warning +LC0016 Caption is missing. Warning +LC0017 Writing to a FlowField is not common. Add a comment to explain this. Warning +LC0018 Events in internal codeunits are not accessible to extensions and should therefore be avoided. Info +LC0019 Data Classification is equal to the Table. Remove to reduce redundancy. Info +LC0020 Applicatication Area is equal to the Page. Remove to reduce redundancy. Info +LC0021 "Confirm() must be implemented through the ""Confirm Management"" codeunit from the System Application." Info +LC0022 "GlobalLanguage() must be implemented through the ""Translation Helper"" codeunit from the Base Application." Info +LC0023 "Fieldgroup ""{0}"" is missing on table ""{1}""." Info +LC0024 Procedure declaration should not end with semicolon. Info +LC0025 Procedure must be either local, internal or define a documentation comment. Hidden +LC0026 ToolTip must end with a dot. Info +LC0027 "Utilize the ""Page Management"" codeunit for launching page." Info +LC0028 Event subscriber arguments now use identifier syntax instead of string literals. Info +LC0029 Use CompareDateTime method in Type Helper codeunit for DateTime variable comparisons. Info +LC0030 Set Access property to Internal for Install/Upgrade codeunits. Info +LC0031 Set ReadIsolation property instead of LockTable method. Info +LC0032 Clear(All) does not affect or change values for global variables in '{0}: Codeunit {1}'. Warning +LC0033 The specified runtime version in app.json is falling behind. The project targets {0} version {1} and the current runtime is {2}. Update the runtime to {3} for compatibility with the latest runtime features. Info +LC0034 The property Extensible should be explicitly set for {0} objects. Hidden +LC0035 Explicitly set AllowInCustomizations for fields omitted on pages. Info +LC0036 "ToolTip must start with the verb ""Specifies""." Info +LC0037 Do not use line breaks in ToolTip. Info +LC0038 Try to not exceed 200 characters (including spaces). Info +LC0039 Argument {0}: cannot convert from '{1}' to '{2}'. Warning +LC0040 Explicitly set the RunTrigger parameter on build-in methods. Info +LC0041 Empty captions should be locked. Info +LC0042 The SetAutoCalcFields method should only be used with FlowFields or fields of type Blob. The field {0} is not a FlowField or of type Blob. Warning +LC0043 Use SecretText type to protect credentials and sensitive textual values from being revealed. Info +LC0044 Records '{0}' and '{1}' have conflicting fields with the same ID Warning +LC0045 Zero (0) Enum value should be reserved for Empty Value. Info +LC0046 Label with suffix Tok must be locked. Info +LC0047 Locked Label must have a suffix Tok. Info +LC0048 Use Error with a ErrorInfo or Label variable to improve telemetry details. Info +LC0049 SourceTable property not defined on {0} '{1}'. Info +LC0050 Operator '{0}' found in filter expression, currently treated as a literal character. Implement StrSubstNo() to apply as operator. Info diff --git a/resources/Place Resources here.txt b/resources/Place Resources here.txt new file mode 100644 index 0000000..4b2025f --- /dev/null +++ b/resources/Place Resources here.txt @@ -0,0 +1,7 @@ +Place any resources related to the project here, such as: + +- images +- PDFs +- config packages +- FOB files +... diff --git a/resources/UiCop.tsv b/resources/UiCop.tsv new file mode 100644 index 0000000..08306d1 --- /dev/null +++ b/resources/UiCop.tsv @@ -0,0 +1,17 @@ +Id Title Category Default Severity New Severity +AW0001 The Web client does not support displaying the Request page of XMLPorts. WebClient Warning +AW0002 The Web client does not support displaying both Actions and Fields in Cue Groups. Only Fields will be displayed. WebClient Warning +AW0003 The Web client does not support displaying Repeater controls containing Parts. WebClient Warning +AW0004 A Blob cannot be used as a source expression for a page field. WebClient Warning +AW0005 Actions should use the Image property. WebClient Info +AW0006 Pages and reports should use the UsageCategory and ApplicationArea properties to be searchable. WebClient Info +AW0007 The Web client does not support displaying Repeater controls that contain FlowFilter fields. WebClient Error +AW0008 The Web client only supports displaying Repeater controls in pages of type List, ListPart, and Worksheet. WebClient Warning +AW0009 Using a Blob with subtype Bitmap on a page field is deprecated. Instead use the Media/MediaSet data types. WebClient Warning +AW0010 A Repeater control used on a List page must be defined at the beginning of the area(Content) section. WebClient Warning +AW0011 "Add PromotedOnly=""true"" to some or all promoted actions to avoid identical actions from appearing in both the promoted and default sections of the command bar." WebClient Info +AW0012 The Web client does not support properties for teaching tips in certain contexts. WebClient Warning +AW0013 Groups containing promoted actions should not be hidden. WebClient Warning +AW0014 Groups containing ActionRef targets should not be hidden. WebClient Warning +AW0015 Actions with scope repeater must be promoted. WebClient Warning +AW0016 Rich Text Editor fields are only allowed while alone in a FastTab group. WebClient Warning diff --git a/scripts/Place Scripts here.txt b/scripts/Place Scripts here.txt new file mode 100644 index 0000000..525685a --- /dev/null +++ b/scripts/Place Scripts here.txt @@ -0,0 +1,5 @@ +Place any scripts related to the project here, such as: + +- custom launch configurations +- PowerShell/Bash scripts +...