Skip to content

Commit

Permalink
style(prettier): update prettier config to single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
dschach committed Sep 18, 2023
1 parent 46463a7 commit 078fe29
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 89 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ""
title: '[BUG]'
labels: ''
assignees: dschach
---

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR]"
labels: ""
title: '[FR]'
labels: ''
assignees: dschach
---

Expand Down
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coverage:
precision: 2
round: down
range: "75...100"
range: '75...100'
status:
patch:
default:
Expand Down
24 changes: 12 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
commit-message:
prefix: "build"
include: "scope"
rebase-strategy: "auto"
prefix: 'build'
include: 'scope'
rebase-strategy: 'auto'
schedule:
interval: "daily"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
interval: 'daily'
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
commit-message:
prefix: "ci"
include: "scope"
rebase-strategy: "auto"
prefix: 'ci'
include: 'scope'
rebase-strategy: 'auto'
schedule:
interval: "daily"
interval: 'daily'
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ on:
branches:
- main
paths:
- "sfdx-source/**"
- "pmd/**"
- 'sfdx-source/**'
- 'pmd/**'

# Jobs to be executed
jobs:
format-lint:
runs-on: ubuntu-latest
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: "Install Volta"
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: "Restore node_modules cache"
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v3
with:
Expand All @@ -35,12 +35,12 @@ jobs:
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: "Install npm dependencies"
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: "Code formatting verification with Prettier"
- name: 'Code formatting verification with Prettier'
run: npm run prettier:apex:verify

pmd-analysis:
Expand All @@ -49,11 +49,11 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install PMD
- name: "Install PMD"
- name: 'Install PMD'
run: |
PMD_VERSION=$(curl -s https://api.github.com/repos/pmd/pmd/releases/latest | grep '.tag_name' | sed 's:.*/::' | sed 's:",::')
echo $PMD_VERSION
Expand All @@ -62,5 +62,5 @@ jobs:
mv ~/pmd-bin-$PMD_VERSION ~/pmd
~/pmd/bin/pmd --version
# Run PMD scan
- name: "Run PMD scan"
- name: 'Run PMD scan'
run: ~/pmd/bin/pmd check --dir force-app --rulesets pmd/deployRules.xml --format text --cache .pmdCache --no-progress --minimum-priority "Medium Low"
6 changes: 3 additions & 3 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
code-coverage:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4
- name: Install Dependencies
run: npm install @salesforce/cli --global
- name: Populate auth file
run: 'echo "${{ secrets.SALESFORCE_AUTH_URL }}" > ./SALESFORCE_AUTH_URL.txt'
- name: Authenticate Dev Hub
run: "sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias DevHub --set-default-dev-hub"
run: 'sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias DevHub --set-default-dev-hub'
- name: Create Scratch Org
run: sf force org create scratch --setdefaultusername --definitionfile config/project-scratch-def.json --setalias ciorg --durationdays 1
- name: Deploy source
Expand All @@ -25,7 +25,7 @@ jobs:
run: sf apex run test --code-coverage --result-format human --output-dir ./
- name: Delete coverage file (temporary fix)
run: rm ./test-result-707*-codecoverage.json
- name: "Upload code coverage for Apex to Codecov.io"
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v3
with:
flags: Apex
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: "Fetch Dependabot metadata"
- name: 'Fetch Dependabot metadata'
id: dependabot
uses: dependabot/fetch-metadata@v1

- name: "Check auto merge conditions"
- name: 'Check auto merge conditions'
id: auto-merge
if: |
(
Expand All @@ -28,7 +28,7 @@ jobs:
)
run: echo "::notice ::auto-merge conditions satisfied"

- name: "Approve and merge PR"
- name: 'Approve and merge PR'
if: ${{ steps.auto-merge.conclusion == 'success' }}
run: |
gh pr review --approve "$PR_URL"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
java-version: '11'
distribution: 'temurin'
- name: Run PMD
id: pmd
uses: pmd/pmd-github-action@v1
with:
rulesets: "pmd/apexQuickStart.xml"
sourcePath: "force-app"
rulesets: 'pmd/apexQuickStart.xml'
sourcePath: 'force-app'
analyzeModifiedFilesOnly: false
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
types: [opened, edited, synchronize, reopened]
paths:
- "force-app/**"
- 'force-app/**'
# Jobs to be executed
jobs:
# Formatting and linting only runs on human-submitted PRs
Expand All @@ -16,15 +16,15 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: "Install Volta"
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: "Restore node_modules cache"
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v3
with:
Expand All @@ -35,12 +35,12 @@ jobs:
npm-
# Install npm dependencies for Prettier and Jest
- name: "Install npm dependencies"
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: "Code formatting verification with Prettier"
- name: 'Code formatting verification with Prettier'
run: npm run prettier:apex:verify

scratch-org-test:
Expand All @@ -49,19 +49,19 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Salesforce CLI
- name: "Install Salesforce CLI"
- name: 'Install Salesforce CLI'
run: |
npm install @salesforce/cli --global
nodeInstallPath=$(npm config get prefix)
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
sf --version
# Store secret for dev hub
- name: "Populate auth file with SALESFORCE_AUTH_URL secret"
- name: 'Populate auth file with SALESFORCE_AUTH_URL secret'
shell: bash
run: |
echo ${{ secrets.SALESFORCE_AUTH_URL}} > ./SALESFORCE_AUTH_URL.txt
Expand All @@ -72,38 +72,38 @@ jobs:
fi
# Authenticate dev hub
- name: "Authenticate Dev Hub"
- name: 'Authenticate Dev Hub'
run: sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias devhub --set-default-dev-hub

# Create scratch org
- name: "Create scratch org"
run: sf org create scratch --definition-file config/project-scratch-def.json --alias RecordTypes --set-default --duration-days 1
- name: 'Create scratch org'
run: sf org create scratch --definition-file config/project-scratch-def.json --alias RecordTypes --set-default --duration-days 1 --no-track-source

# Deploy source to scratch org
- name: "Push main directory to scratch org"
- name: 'Push main directory to scratch org'
run: sf project deploy start

- name: "Push permission set"
- name: 'Push permission set'
run: sf project deploy start --source-dir unpackaged

- name: "Assign Permission Set"
- name: 'Assign Permission Set'
run: sf org assign permset --name RecordTypes_DefaultRT_for_Testing

# Run Apex tests in scratch org
- name: "Run Apex tests"
- name: 'Run Apex tests'
run: sf apex run test --code-coverage --result-format human --output-dir ./tests/apex --wait 20

# Delete temporary test file that Codecov is unable to parse
#- name: "Delete coverage file (temporary step)"
# run: rm ./tests/apex/test-result-707*-codecoverage.json

# Upload code coverage data
- name: "Upload code coverage for Apex to Codecov.io"
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v3
with:
flags: Apex

# Housekeeping
- name: "Delete scratch org"
- name: 'Delete scratch org'
if: always()
run: sf org delete scratch --no-prompt --target-org RecordTypes
17 changes: 15 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"useTabs": true,
"printWidth": 160,
"tabWidth": 2,
"singleQuote": true,
"overrides": [
{
"files": "**/lwc/**/*.html",
Expand All @@ -19,7 +20,7 @@
},
{
"files": "*.{yaml,yml}",
"options": { "useTabs": false }
"options": { "useTabs": false, "tabWidth": 2, "singleQuote": true }
},
{
"files": "*.json",
Expand All @@ -28,7 +29,19 @@
"parser": "json",
"printWidth": 80
}
},
{
"files": "docs/*.html",
"options": {
"parser": "html",
"useTabs": true,
"tabWidth": 2,
"printWidth": 150,
"htmlWhitespaceSensitivity": "css",
"singleQuote": false
}
}
],
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"]
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"],
"$schema": "https://json.schemastore.org/prettierrc"
}
24 changes: 12 additions & 12 deletions apexdox.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
engine:
source:
- path: "${workspaceFolder}/force-app/main/default/classes"
- path: '${workspaceFolder}/force-app/main/default/classes'
sourceUrl: https://github.com/dschach/record-types/tree/main
targetDirectory: "${workspaceFolder}/docs"
targetDirectory: '${workspaceFolder}/docs'
#excludes:
# - "*Test.cls"
title: Record Types code documentation
Expand All @@ -17,19 +17,19 @@ engine:
- private
#- webService
- testMethod
homePagePath: "${workspaceFolder}/doc-assets/main.html"
homePagePath: '${workspaceFolder}/doc-assets/main.html'
pages:
- "${workspaceFolder}/doc-assets/changelog.html"
- '${workspaceFolder}/doc-assets/changelog.html'
#- "${workspaceFolder}/doc-assets/RecordTypesHome.html"
assets:
- "${workspaceFolder}/doc-assets/logo.png"
- "${workspaceFolder}/doc-assets/favicon.png"
- "${workspaceFolder}/doc-assets/icon.png"
- "${workspaceFolder}/doc-assets/highlight.css"
- "${workspaceFolder}/doc-assets/styling.css"
- "${workspaceFolder}/doc-assets/index.css"
- "${workspaceFolder}/doc-assets/highlight.js"
- "${workspaceFolder}/doc-assets/index.js"
- '${workspaceFolder}/doc-assets/logo.png'
- '${workspaceFolder}/doc-assets/favicon.png'
- '${workspaceFolder}/doc-assets/icon.png'
- '${workspaceFolder}/doc-assets/highlight.css'
- '${workspaceFolder}/doc-assets/styling.css'
- '${workspaceFolder}/doc-assets/index.css'
- '${workspaceFolder}/doc-assets/highlight.js'
- '${workspaceFolder}/doc-assets/index.js'

port: 8080
docblock:
Expand Down
Loading

0 comments on commit 078fe29

Please sign in to comment.