Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add --forbid-only to husky hook, fix nyc file #47

Merged
merged 7 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
{
"nyc": {
"extends": "@salesforce/dev-config/nyc",
"check-coverage": true,
"lines": 90,
"statements": 90,
"functions": 90,
"branches": 90,
"reporter": ["lcov", "text"],
"extension": [".js"],
"exclude": ["bin/**/*.js", "**/*.test.js"]
}
}
"extends": "@salesforce/dev-config/nyc",
"exclude": ["bin/**/*.js", "**/*.test.js"]
}
2 changes: 1 addition & 1 deletion bin/sf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const mocha = require.resolve('mocha/bin/mocha');

const config = resolveConfig(packageRoot);
const testConfig = config.test || {};
const includes = testConfig.testsPath || '**/*.test.ts';
const includes = testConfig.testsPath || 'test/**/*.test.ts';

const command = `node ${nyc} ${mocha} "${includes}"`;

Expand Down
4 changes: 1 addition & 3 deletions files/nycrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"nyc": {
"extends": "@salesforce/dev-config/nyc"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^10.0.0",
"@oclif/dev-cli": "^1",
"@salesforce/dev-config": "^2.1.2",
"@salesforce/dev-config": "^2.1.3",
"@salesforce/prettier-config": "^0.0.2",
"@types/chai": "^4.2.11",
"@types/mocha": "^8.2.2",
Expand Down
2 changes: 1 addition & 1 deletion utils/husky-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function initializeHusky() {
if (localGitHooks.length === 0) {
shell.exec("yarn husky add .husky/commit-msg 'yarn commitlint --edit'");
shell.exec("yarn husky add .husky/pre-commit 'yarn lint && yarn pretty-quick --staged'");
shell.exec("yarn husky add .husky/pre-push 'yarn build && yarn test'");
shell.exec("yarn husky add .husky/pre-push 'yarn build && yarn test --forbid-only'");
}
} catch (err) {
if (err.code === 'ENOENT') {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,10 @@
resolved "https://registry.npmjs.org/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493"
integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw==

"@salesforce/dev-config@^2.1.2":
version "2.1.2"
resolved "https://registry.npmjs.org/@salesforce/dev-config/-/dev-config-2.1.2.tgz#b4e206f860e87065d068bf8ba3994a032389ad81"
integrity sha512-1swy07rynHoTRk8lj6nuC0JceRBo300OuWnovQe2OMvLpQM5Dh1SUnv1SE8012PsrK9BC1WqGXp4BUyMo04x7w==
"@salesforce/dev-config@^2.1.3":
version "2.1.3"
resolved "https://registry.npmjs.org/@salesforce/dev-config/-/dev-config-2.1.3.tgz#77fa29be9e1df2c5919c36d55b2fef9c9be27c46"
integrity sha512-J6NRMfwzgbKgo6/mO0ZhPxDKVNhoEd044vCTAxWLVJA5Ld7mB+/Sx6oosW89FvIkl0098LyfIMmwRDu/zcZd9g==

"@salesforce/prettier-config@^0.0.2":
version "0.0.2"
Expand Down