Skip to content

Commit

Permalink
Testing pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
tibuurcio committed Jan 16, 2024
1 parent e847659 commit 19daf47
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
37 changes: 22 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ Thanks for contributing! Please read this document to follow our conventions for

## Setting Up

- Fork the repository and then clone down your fork
- Commit your code per the conventions below, and PR into the repository's `main` branch
- Your PR title will be checked automatically against the below convention (view the commit history to see examples of a proper commit/PR title). If it fails, you must update your title.
- Our engineers will work with you to get your code change implemented once a PR is up
- Fork the repository and then clone down your fork
- Run `npm run prepare` to setup Husky pre-commit hooks
- Commit your code per the conventions below, and PR into the repository's `main` branch
- Your PR title will be checked automatically against the below convention (view the commit history to see examples of a proper commit/PR title). If it fails, you must update your title.
- Our engineers will work with you to get your code change implemented once a PR is up

## PR Title and Commit Convention

Expand All @@ -25,16 +26,22 @@ The standard format for commit messages is as follows:

The following lists the different `types` allowed in the commit message:

- feat: A new feature (automatic minor release)
- fix: A bug fix (automatic patch release)
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing or correcting existing tests
- chore: Changes that don't modify src or test files, such as automatic documentation generation, or building latest assets
- ci: Changes to CI configuration files/scripts
- revert: Revert commit
- build: Changes that affect the build system or other dependencies
- feat: A new feature (automatic minor release)
- fix: A bug fix (automatic patch release)
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing or correcting existing tests
- chore: Changes that don't modify src or test files, such as automatic documentation generation, or building latest assets
- ci: Changes to CI configuration files/scripts
- revert: Revert commit
- build: Changes that affect the build system or other dependencies

In the footer, if there is a breaking change, start your footer with `BREAKING CHANGE:` followed by a description.

## Editor configuration

- **Prettier**: For configuring your editor to play nicely with Prettier, take a look at the [Editors doc page](https://prettier.io/docs/en/editors).
- Also, if you're using VSCode you might want to set prettier as the default formatter and also turn on "Format on Save" option.
- **ESLint**: Check [Integrations doc page](https://eslint.org/docs/latest/use/integrations)
5 changes: 0 additions & 5 deletions docs/dev.md

This file was deleted.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
"build-dist": "sh ./scripts/build-dist.sh",
"build-storybook": "storybook build",
"tokens-to-css": "npx style-dictionary build --config ./style-dictionary.json",
"prepare": "husky install",
"lint": "eslint --ext .ts,.tsx,.js,.jsx \"src/**/*.{ts,js,tsx,jsx}\""
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"npm lint --fix",
"prettier --write"
],
"*.{json,yml,md}": [
"prettier --write"
]
}
}

0 comments on commit 19daf47

Please sign in to comment.