-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from SalesforceFoundation/feature/pre-commit
[W-8840996] Outbound Funds NPSP: Add automated checks + dev tools
- Loading branch information
Showing
62 changed files
with
11,077 additions
and
2,049 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
// See https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell#cspelljson-sections | ||
// for more information. | ||
// Always 0.1 | ||
"version": "0.1", | ||
"language": "en-US", | ||
"enableFiletypes": ["apex", "javascript", "html", "SQL", "python"], | ||
"allowCompoundWords": true, | ||
// List of words to be considered correct. | ||
"words": [ | ||
// SFDO | ||
"cumulusci", | ||
"outfunds", | ||
"outfundsnpspext", | ||
"sfdobase", | ||
"unpackaged", | ||
"unmanaged", | ||
// SFDC | ||
"instanceof", | ||
"canvasapp", | ||
"flexi", | ||
"flexipage", | ||
"flexipages", | ||
"appendable", | ||
"prependable", | ||
"sobject", | ||
"sobjects", | ||
"permset", | ||
"sforce", | ||
"ISBLANK", | ||
"ISPICKVAL", | ||
"upsert", | ||
"outputdir", | ||
"sfsites", | ||
"valueOf", | ||
"stubbable", | ||
"ISNULL", | ||
"noopener", | ||
"noreferrer", | ||
"reparentable", | ||
// LWC | ||
"onrowselection", | ||
"onrowaction", | ||
"onsearch", | ||
"recordid", | ||
"onremove", | ||
"onupdate", | ||
"ondelete", | ||
// Python | ||
"pylint", | ||
"pytest", | ||
"toprettyxml", | ||
"VARCHAR", | ||
"esprima", | ||
"Punctuator", | ||
"isupper", | ||
"nargs", | ||
"tostring", | ||
"testdoc", | ||
"mkdtemp", | ||
"noyaml", | ||
// HTML | ||
"arial", | ||
"onslotchange", | ||
"iframe", | ||
// Robot tests | ||
"kwtable", | ||
"kwrow", | ||
"kwname", | ||
"kwdoc", | ||
"XHTTP", | ||
"CUSTENT", | ||
// Storytelling data | ||
"Englewood", | ||
"Takagawa", | ||
"Atterberry", | ||
"Meiko", | ||
"Kumar", | ||
// Local | ||
"Behrens", | ||
"Expendatures" | ||
], | ||
// List of words to be always considered incorrect. | ||
"flagWords": [], | ||
// List of words to be ignored (even if they are in the flagWords). | ||
"ignoreWords": [], | ||
// List of globs to specify which files are to be ignored. | ||
"ignorePaths": [ | ||
"node_modules/**", | ||
"robot/**/results/**", | ||
"venv/**", | ||
".github/**", | ||
".cci/**", | ||
"./pytest_cache", | ||
".sfdx/**", | ||
".vscode/**", | ||
"force-app/main/default/objectTranslations/**", | ||
"force-app/main/default/translations/**", | ||
"coverage/**" | ||
], | ||
// defaults to 4 - the minimum length of a word before it is checked. | ||
"minWordLength": 5, | ||
"languageSettings": [ | ||
{ | ||
// Add HTML dictionary to python since robot tests contain HTML. | ||
"languageId": "python", | ||
"local": "*", | ||
"ignoreRegExpList": [], | ||
"dictionaries": ["html"], | ||
"dictionaryDefinitions": [] | ||
} | ||
], | ||
"ignoreRegExpList": [ | ||
// customThemeLayoutType has randomish IDs | ||
"<customThemeLayoutType>[\\S\\s]+?</customThemeLayoutType>", | ||
// Salesforce IDs: trying to be as restrive as possible in regex pattern | ||
// See: https://help.salesforce.com/articleView?id=000325244&language=&type=1&mode=1 | ||
"\\b[0-9aemzkXC][A-Za-z0-9]{14,17}\\b" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
* | ||
!**/ | ||
!**/lwc/**/*.js | ||
node_modules | ||
.cci | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
env: | ||
browser: true | ||
es6: true | ||
extends: | ||
- eslint:recommended | ||
- prettier | ||
- plugin:prettier/recommended | ||
- "@salesforce/eslint-config-lwc/recommended" | ||
globals: | ||
Atomics: readonly | ||
SharedArrayBuffer: readonly | ||
parserOptions: | ||
ecmaVersion: 2018 | ||
sourceType: module | ||
parser: babel-eslint | ||
plugins: | ||
- prettier | ||
- "@lwc/eslint-plugin-lwc" | ||
rules: | ||
"prettier/prettier": error | ||
"@lwc/lwc/no-deprecated": error | ||
"@lwc/lwc/valid-api": error | ||
"@lwc/lwc/valid-track": error | ||
"@lwc/lwc/valid-wire": error | ||
"@lwc/lwc/no-document-query": error | ||
"@lwc/lwc/consistent-component-name": error | ||
"@lwc/lwc/no-leading-uppercase-api-name": error | ||
"@lwc/lwc/no-dupe-class-members": error | ||
"@lwc/lwc/no-inner-html": error | ||
"@lwc/lwc/no-async-operation": error | ||
"no-unused-vars": warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Black-compatible flake8 config | ||
|
||
[flake8] | ||
ignore = E203, E266, E402, E501, W503, C901 | ||
max-line-length = 80 | ||
max-complexity = 18 | ||
select = B,C,E,F,W,T4,B9 | ||
exclude = | ||
node_modules, | ||
venv, | ||
.cci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
**/jsconfig.json | ||
# LWC Jest tests | ||
**/__mocks__/** | ||
**/__tests__/** | ||
|
||
# eslint config for Lightning Web Components | ||
**/jsconfig.json | ||
**/.eslintrc.json | ||
|
||
# All markdown files. This means you can add READMEs to class and component directories. | ||
**/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Spell Checking | ||
on: [push] | ||
jobs: | ||
cspell: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '14' | ||
- name: Determine Node Version | ||
id: node-version | ||
run: | | ||
echo "::set-output name=ver::$(node --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ steps.node-version.outputs.ver }}-${{ hashFiles('package.json', 'yarn.lock') }} | ||
- name: Install Packages | ||
run: | | ||
yarn install | ||
- name: cspell | ||
run: | | ||
npx cspell "**/*.{cls,apex,trigger,js,html,md,xml,sql,py,yml,yaml}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Linting | ||
on: [push] | ||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '14' | ||
- name: Determine Node Version | ||
id: node-version | ||
run: | | ||
echo "::set-output name=ver::$(node --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ steps.node-version.outputs.ver }}-${{ hashFiles('package.json', 'yarn.lock') }} | ||
- name: Install Packages | ||
run: | | ||
yarn install | ||
- name: eslint | ||
run: | | ||
npx eslint "**/*.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Jest | ||
on: [push] | ||
jobs: | ||
jest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '14' | ||
- name: Determine Node Version | ||
id: node-version | ||
run: | | ||
echo "::set-output name=ver::$(node --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ steps.node-version.outputs.ver }}-${{ hashFiles('package.json', 'yarn.lock') }} | ||
- name: Install Packages | ||
run: | | ||
yarn install | ||
- name: Run Jest Tests | ||
run: | | ||
npx lwc-jest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Label Audit | ||
on: [push] | ||
jobs: | ||
labels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.8' | ||
- name: Determine Python Version | ||
id: python-version | ||
run: | | ||
echo "::set-output name=ver::$(python --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: venv | ||
key: ${{ runner.os }}-${{ steps.python-version.outputs.ver }}-${{ hashFiles('requirements.txt') }} | ||
- name: Install Packages | ||
run: | | ||
python3 -m venv venv | ||
venv/bin/pip install -r requirements.txt | ||
- name: Label Audit | ||
run: | | ||
venv/bin/python scripts/label_audit.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Lockfile | ||
on: [push] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '14' | ||
- name: Determine Node Version | ||
id: node-version | ||
run: | | ||
echo "::set-output name=ver::$(node --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ steps.node-version.outputs.ver }}-${{ hashFiles('package.json', 'yarn.lock') }} | ||
- name: Install Packages | ||
run: | | ||
yarn install | ||
- name: lockfile-lint | ||
run: | | ||
npx lockfile-lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Formatting | ||
on: [push] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '14' | ||
- name: Determine Node Version | ||
id: node-version | ||
run: | | ||
echo "::set-output name=ver::$(node --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ steps.node-version.outputs.ver }}-${{ hashFiles('package.json', 'yarn.lock') }} | ||
- name: Install Packages | ||
run: | | ||
yarn install | ||
- name: prettier | ||
run: | | ||
npx prettier "**/*.{cls,apex,js,html,md,yml,yaml,json}" --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Python | ||
on: [push] | ||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.8' | ||
- name: Determine Python Version | ||
id: python-version | ||
run: | | ||
echo "::set-output name=ver::$(python --version)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: venv | ||
key: ${{ runner.os }}-${{ steps.python-version.outputs.ver }}-${{ hashFiles('requirements.txt') }} | ||
- name: Install Packages | ||
run: | | ||
python3 -m venv venv | ||
venv/bin/pip install -r requirements.txt | ||
- name: Pytest | ||
run: | | ||
venv/bin/pytest |
Oops, something went wrong.