Skip to content

Commit

Permalink
feat: convert the pre-commit hook to a pre-push hook
Browse files Browse the repository at this point in the history
  • Loading branch information
dotmh committed Mar 13, 2024
1 parent da6c583 commit e4f86cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm githook:prepush
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ so much. It assumes that you want to make a Typescript project, whether for the

1. Create a new repo from this
[template in github](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)
2. Duplicate the `hello` example in [libs/hello](https://github.com/dotmh/ts/blob/8a73d4eee158c9afa67b9c0dd721e8b4d0738231/libs/hello) and delete the original
2. Duplicate the `hello` example in [libs/hello](libs/hello) and delete the original
3. Connect to a new [Codespace](https://docs.github.com/en/codespaces/getting-started/quickstart)
4. Start building out your project

Optional

- Add new packages to [pnpm-workspace.yaml](https://github.com/dotmh/ts/blob/e292b37a68e647c445d6073c9d11d27677626d31/pnpm-workspace.yaml) such as `apps` , `bins` etc.
- Add new packages to [pnpm-workspace.yaml](pnpm-workspace.yaml) such as `apps` , `bins` etc.

## Technology

Expand Down Expand Up @@ -55,7 +55,8 @@ The repo makes use of [secret lint](https://github.com/secretlint/secretlint) to

## CI

Makes use of Github actions, by default this will only [test the code](https://github.com/dotmh/ts/blob/a39ada806083c00c00216cdefb124b441bbe4bbb/.github/workflows/test-actions.yml)
Makes use of Github actions, by default this will [test the code](.github/workflows/test-actions.yml) and
in a separate parallel action it will [lint the code](.github/workflows/lint-actions.yml)

## Committing

Expand All @@ -67,7 +68,7 @@ When you make a commit the following will happen **BEFORE** the commit is added
4. Run the tests on all packages in the workspace - **BLOCKING**
5. Check your git message conforms to conventional commits - **BLOCKING**

This can be changed by changing the pnpm script `precommit` in the root [package.json](https://github.com/dotmh/ts/blob/d810594092ff2d0c5240b77828645aa23a7cda77/package.json#L16)
This can be changed by changing the pnpm script `precommit` in the root [package.json](package.json#L16)

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"format:check": "prettier --check .",
"lint:check": "eslint . --ext .ts --fix-dry-run",
"lint:secrets": "secretlint \"**/*\"",
"precommit": "pnpm run lint:secrets && pnpm run lint:check && pnpm run format:check && pnpm run test"
"githook:prepush": "pnpm run lint:secrets && pnpm run lint:check && pnpm run format:check && pnpm run test"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit e4f86cc

Please sign in to comment.