Skip to content

Commit fc42947

Browse files
authored
feat: improve implementation and documentation (#7)
1 parent 3848d93 commit fc42947

Some content is hidden

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

49 files changed

+1102
-611
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
./sfdx-cli/install
2424
2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727

2828
- name: "Populate auth file with CI_URL secret"
2929
shell: bash

.github/workflows/pull-request.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: "Checkout source code"
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
1315

1416
- uses: actions/cache@v2
1517
with:
@@ -23,21 +25,24 @@ jobs:
2325
echo "SFDX_DISABLE_AUTOUPDATE=true" >> $GITHUB_ENV
2426
echo "SFDX_DISABLE_TELEMETRY=true" >> $GITHUB_ENV
2527
26-
- name: Install Salesforce CLI
28+
- name: Install SFDX CLI and Scanner
2729
run: |
28-
wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
29-
mkdir sfdx-cli
30-
tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1
31-
./sfdx-cli/install
30+
npm install sfdx-cli
31+
node_modules/sfdx-cli/bin/run plugins:install @salesforce/sfdx-scanner
3232
3333
- name: "Install npm dependencies"
3434
run: npm install
3535

3636
- name: "Code formatting verification with Prettier"
3737
run: npm run prettier:verify
3838

39-
- name: Execute Static Analysis
40-
run: npm run lint
39+
- name: "Apex static analysis"
40+
uses: mitchspano/sfdx-scan-pull-request@v0.1.3
41+
with:
42+
pmdconfig: apex-ruleset.xml
43+
severity-threshold: 4
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4146

4247
ci-build:
4348
runs-on: ubuntu-latest
@@ -56,7 +61,7 @@ jobs:
5661
./sfdx-cli/install
5762
5863
- name: Checkout
59-
uses: actions/checkout@v2
64+
uses: actions/checkout@v3
6065

6166
- name: "Populate auth file with CI_URL secret"
6267
shell: bash

.gitignore

+46-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
.vscode
2-
.sfdx
1+
# This file is used for Git repositories to specify intentionally untracked files that Git should ignore.
2+
# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore
3+
# For useful gitignore templates see: https://github.com/github/gitignore
4+
5+
# Salesforce cache
6+
.sf/
7+
.sfdx/
8+
.vscode/
9+
.localdevserver/
10+
deploy-options.json
11+
12+
# SFDX
313
tests
4-
node_modules/
14+
15+
# LWC VSCode autocomplete
16+
**/lwc/jsconfig.json
17+
18+
# LWC Jest coverage reports
19+
coverage/
20+
21+
# Logs
22+
logs
23+
*.log
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# Dependency directories
29+
node_modules/
30+
31+
# Eslint cache
32+
.eslintcache
33+
34+
# MacOS system files
35+
.DS_Store
36+
37+
# Windows system files
38+
Thumbs.db
39+
ehthumbs.db
40+
[Dd]esktop.ini
41+
$RECYCLE.BIN/
42+
43+
# Local environment variables
44+
.env
45+
46+
# SFDX
47+
tests/

.lintstagedrc

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,yaml,yml}": [
3-
"prettier --write"
4-
],
5-
"**/classes/*.cls": [
6-
"sfdx scanner:run -v -f table -c 'Async-Linkable' -t "
7-
]
8-
}
2+
"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,yaml,yml}": [
3+
"prettier --write"
4+
]
5+
}

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
.sfdx
21
.github
2+
.sf
3+
.sfdx
34
.vscode
45
coverage/
56
tests/

0 commit comments

Comments
 (0)