Skip to content

Commit

Permalink
chore: Add commitlint to verify commit message format (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
untemps authored Aug 12, 2020
1 parent 679974e commit 74d9a6a
Show file tree
Hide file tree
Showing 6 changed files with 397 additions and 29 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ const App = () => {

The process to grant microphone access permissions is automatically managed by the hook (internally used by the `Vocal` component).

## Todos
## Contributing

- Add a connector management to plug external speech-to-text services in
Contributions are warmly welcomed:
- Fork the repository
- Create a feature branch (preferred name convention: `[feature type]_[imperative verb]-[description of the feature]`)
- Develop the feature AND write the tests (or write the tests AND develop the feature)
- Commit your changes using [Angular Git Commit Guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines)
- Submit a Pull Request

## Roadmap

- Add a connector management to plug external speech-to-text services in
- Accept more ways to customize children
7 changes: 7 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [2, 'always', ['sentence-case']],
'scope-case': [2, 'always', ['lower-case', 'upper-case']]
},
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@rollup/plugin-babel": "^5.0.2",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
Expand Down Expand Up @@ -70,7 +72,8 @@
},
"husky": {
"hooks": {
"pre-commit": "yarn test:ci && yarn prettier"
"pre-commit": "yarn test:ci && yarn prettier",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"release": {
Expand Down
12 changes: 9 additions & 3 deletions src/components/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import PropTypes from 'prop-types'

const Icon = ({ color, activeColor, isActive }) => {
return (
<svg data-testid="__icon-root__" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24">
<svg
data-testid="__icon-root__"
xmlns="http://www.w3.org/2000/svg"
width="100%"
height="100%"
viewBox="0 0 24 24"
>
<g>
<path
data-testid="__icon-path__"
Expand All @@ -19,13 +25,13 @@ const Icon = ({ color, activeColor, isActive }) => {
Icon.propTypes = {
color: PropTypes.string,
activeColor: PropTypes.string,
isActive: PropTypes.bool
isActive: PropTypes.bool,
}

Icon.defaultProps = {
color: 'black',
activeColor: 'red',
isActive: false
isActive: false,
}

export default Icon
2 changes: 1 addition & 1 deletion src/components/__tests__/Icon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Icon', () => {

it('renders component color', () => {
const color = 'green'
const { queryByTestId } = render(getInstance({color}))
const { queryByTestId } = render(getInstance({ color }))
expect(queryByTestId('__icon-path__')).toHaveAttribute('fill', color)
})

Expand Down
Loading

0 comments on commit 74d9a6a

Please sign in to comment.