Skip to content

Commit 6f8c7f3

Browse files
aholstrup1freddydk
andauthored
Fix all issues found by pre-commit and add a pre-commit check to PRs (microsoft#1112)
This PR should go in after microsoft#955 This PR: * Fixes all the issues found by the pre-commit hooks (by running `pre-commit run --all-files`) * Adds a check on future AL-Go PRs to ensure the pre-commit hooks have been run. --------- Co-authored-by: Freddy Kristiansen <[email protected]>
1 parent ae5d800 commit 6f8c7f3

File tree

147 files changed

+932
-522
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+932
-522
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ updates:
1818
schedule:
1919
interval: weekly
2020
ignore:
21-
- dependency-name: "microsoft/AL-Go-Actions/*"
21+
- dependency-name: "microsoft/AL-Go-Actions/*"

.github/workflows/Deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ on:
3232
description: 'Which version of BcContainerHelper to use? (latest, preview, private, a specific version number or a direct download URL like https://github.com/freddydk/navcontainerhelper/archive/master.zip). Leave empty to use latest (or preview for preview branches)'
3333
required: false
3434
default: 'latest'
35-
35+
3636
permissions:
3737
contents: read
3838
actions: read

.github/workflows/pre-commit.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pre-commit
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
- uses: pre-commit/[email protected]
16+
with:
17+
extra_args: --all-files

Actions/AL-Go-Helper.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -2367,4 +2367,4 @@ function Get-PackageVersion($PackageName) {
23672367
else {
23682368
throw "Package $PackageName is not in the list of packages"
23692369
}
2370-
}
2370+
}

Actions/AddExistingApp/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Add existing app
2+
23
Add an existing app to an AL-Go for GitHub repository
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -19,4 +22,5 @@ none
1922
| directCommit | | true if the action should create a direct commit against the branch or false to create a Pull Request | false |
2023

2124
## OUTPUT
22-
none
25+
26+
none

Actions/AnalyzeTests/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Analyze Tests
2+
23
Analyze results of tests from the RunPipeline action
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -16,12 +19,15 @@ none
1619
## OUTPUT
1720

1821
### ENV variables
22+
1923
none
2024

2125
### OUTPUT variables
26+
2227
| Name | Description |
2328
| :-- | :-- |
24-
| TestResultMD | MarkDown of the test result with \n instead of line breaks |
29+
| TestResultMD | MarkDown of the test result with \\n instead of line breaks |
2530

2631
### SUMMARY
32+
2733
This function will set the test result markdown in the GITHUB_STEP_SUMMARY section

Actions/BuildPowerPlatform/BuildPowerPlatform.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,4 @@ if ($environmentName -and $companyId) {
271271
}
272272
else {
273273
Write-Host "Skip Business Central connection settings update since EnvironmentName and CompanyId are not set"
274-
}
274+
}

Actions/BuildPowerPlatform/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Build Power Platform
2+
23
Build the Power Platform solution
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -19,4 +22,5 @@ none
1922
| appRevision | | The app revision number | |
2023

2124
## OUTPUT
25+
2226
none

Actions/BuildPowerPlatform/action.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ runs:
3737
- name: Install Power Platform Tools
3838
uses: microsoft/powerplatform-actions/actions-install@v1
3939

40-
- name: Update Power Platform Files
40+
- name: Update Power Platform Files
4141
shell: ${{ inputs.shell }}
4242
env:
4343
_solutionFolder: ${{ inputs.solutionFolder }}
4444
_companyId: ${{ inputs.companyId }}
45-
_environmentName: ${{ inputs.environmentName }}
45+
_environmentName: ${{ inputs.environmentName }}
4646
_appBuild: ${{ inputs.appBuild }}
4747
_appRevision: ${{ inputs.appRevision }}
4848
run: |
@@ -53,7 +53,7 @@ runs:
5353
catch {
5454
Write-Host "::ERROR::Unexpected error when running action. Error Message: $($_.Exception.Message.Replace("`r",'').Replace("`n",' ')), StackTrace: $($_.ScriptStackTrace.Replace("`r",'').Replace("`n",' <- '))";
5555
exit 1
56-
}
56+
}
5757
5858
- name: Test Pack (Not real - just workaround for https://github.com/microsoft/powerplatform-vscode/issues/412)
5959
uses: microsoft/powerplatform-actions/pack-solution@v1
@@ -74,7 +74,7 @@ runs:
7474
solution-folder: ${{ inputs.solutionFolder }}
7575
solution-type: "Unmanaged"
7676
process-canvas-apps: true
77-
77+
7878
branding:
7979
icon: terminal
80-
color: blue
80+
color: blue

Actions/BuildReferenceDocumentation/BuildReferenceDocumentation.HelperFunctions.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,4 @@ function CalculateProjectsAndApps {
295295
}
296296
$allApps
297297
}
298-
}
298+
}
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# BuildReferenceDocumentation
2+
23
Build documentation using [ALDoc](https://go.microsoft.com/fwlink/?linkid=2247728) and [DocFx](https://dotnet.github.io/docfx)
34

45
## INPUT
56

67
### ENV variables
8+
79
| Name | Description |
810
| :-- | :-- |
911
| Settings | env.Settings must be set by a prior call to the ReadSettings Action |
1012

1113
### Parameters
14+
1215
| Name | Required | Description | Default value |
1316
| :-- | :-: | :-- | :-- |
1417
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
1518
| token | | The GitHub token running the action | github.token |
1619
| artifacts | Yes | The artifacts to build documentation for or a folder in which the artifacts have been downloaded | |
1720

1821
## OUTPUT
22+
1923
none

Actions/CalculateArtifactNames/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Calculate Artifact Names
2+
23
Calculate Artifact Names for AL-Go workflows
34

45
## INPUT
56

67
### ENV variables
8+
79
| Name | Description |
810
| :-- | :-- |
911
| Settings | env.Settings must be set by a prior call to the ReadSettings Action |
1012

1113
### Parameters
14+
1215
| Name | Required | Description | Default value |
1316
| :-- | :-: | :-- | :-- |
1417
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -19,9 +22,11 @@ Calculate Artifact Names for AL-Go workflows
1922
## OUTPUT
2023

2124
### ENV variables
25+
2226
none
2327

2428
### OUTPUT variables
29+
2530
| Name | Description |
2631
| :-- | :-- |
2732
| ThisBuildAppsArtifactsName | Artifact name for apps being built in the current workflow run |

Actions/CheckForUpdates/CheckForUpdates.HelperFunctions.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,4 @@ function UpdateSettingsFile {
426426
}
427427
# Save the file with LF line endings and UTF8 encoding
428428
$settings | Set-JsonContentLF -path $settingsFile
429-
}
429+
}

Actions/CheckForUpdates/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Check for updates
2+
23
Check for updates to AL-Go system files and perform the update if requested
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -19,4 +22,5 @@ none
1922
| directCommit | | True if the action should create a direct commit against the branch or false to create a Pull Request | false |
2023

2124
## OUTPUT
22-
none
25+
26+
none

Actions/CreateApp/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Create a new app
2+
23
Create a new app and add it to an AL-Go repository
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -24,4 +27,5 @@ none
2427
| directCommit | | true if the action should create a direct commit against the branch or false to create a Pull Request | false |
2528

2629
## OUTPUT
30+
2731
none

Actions/CreateDevelopmentEnvironment/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Create Development Environment
2+
23
Create an online development environment
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -21,4 +24,5 @@ none
2124
| directCommit | | true if the action should create a direct commit against the branch or false to create a Pull Request | false |
2225

2326
## OUTPUT
24-
none
27+
28+
none

Actions/CreateReleaseNotes/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Creates release notes
2+
23
Creates release notes for a release, based on a given tag and the tag from the latest release
34

45
## INPUT
56

67
### ENV variables
8+
79
none
810

911
### Parameters
12+
1013
| Name | Required | Description | Default value |
1114
| :-- | :-: | :-- | :-- |
1215
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -18,9 +21,11 @@ none
1821
## OUTPUT
1922

2023
### ENV variables
24+
2125
none
2226

2327
### OUTPUT variables
28+
2429
| Name | Description |
2530
| :-- | :-- |
2631
| ReleaseVersion | The release version |

Actions/Deliver/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# Deliver
2+
23
Deliver App to deliveryTarget (AppSource, Storage, or...)
34

45
## INPUT
56

67
### ENV variables
8+
79
| Name | Description |
810
| :-- | :-- |
911
| Settings | env.Settings must be set by a prior call to the ReadSettings Action |
1012
| Secrets | env.Secrets with delivery target context secrets must be read by a prior call to the ReadSecrets Action |
1113

1214
### Parameters
15+
1316
| Name | Required | Description | Default value |
1417
| :-- | :-: | :-- | :-- |
1518
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -24,4 +27,5 @@ Deliver App to deliveryTarget (AppSource, Storage, or...)
2427
| goLive | | Only relevant for AppSource delivery type. Promote AppSource App to Go Live? | false |
2528

2629
## OUTPUT
30+
2731
none

Actions/Deploy/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# Deploy
2+
23
Deploy Apps to online environment
34

45
## INPUT
56

67
### ENV variables
8+
79
| Name | Description |
810
| :-- | :-- |
911
| Settings | env.Settings must be set by a prior call to the ReadSettings Action |
1012
| Secrets | env.Secrets with delivery target context secrets must be read by a prior call to the ReadSecrets Action |
1113
| deviceCode | When deploying to a single environment which doesn't have an AuthContext, we will wait for the user to finalize the deviceflow with this deviceCode |
1214

1315
### Parameters
16+
1417
| Name | Required | Description | Default value |
1518
| :-- | :-: | :-- | :-- |
1619
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
@@ -21,6 +24,7 @@ Deploy Apps to online environment
2124
| deploymentEnvironmentsJson | Yes | The settings for all Deployment Environments | |
2225

2326
## OUTPUT
27+
2428
| Name | Description |
2529
| :-- | :-- |
2630
| environmentUrl | The URL for the environment. This URL is presented in the Deploy Step in summary under the environment name |

0 commit comments

Comments
 (0)