DevDogs-UGA / DevDogs-Website

The DevDogs Website's frontend repository.
https://www.devdogs.uga.edu
0 stars 15 forks source link

Precommit and pr template created #88

Closed jayp822 closed 2 weeks ago

jayp822 commented 1 month ago

The precommit file addition allows for formatting and linting to be performed and checked before all commits so a contributor does not push a branch that does not adhere to the CI/CD.

The pr template file helps to standardize all pull requests so there is a template generated each time someone create a pr that tells the author to add information about the pr.

ggliv commented 1 month ago

I thought the pre-commit stuff was already set up via Husky but it turns out I mistakenly added the .husky directory to our ignores when getting things set up.

Here's a patch to fix that. ```diff diff --git a/.gitignore b/.gitignore index b69d01b..09c7e85 100644 --- a/.gitignore +++ b/.gitignore @@ -35,9 +35,6 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts -# husky -/.husky/ - # eslint /.eslintcache .idea/inspectionProfiles/Project_Default.xml diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..2312dc5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged ```

If you'd prefer to stick with your approach, note that contributors will need to set up the hook themselves by either configuring core.hooksPath or symlinking $GIT_DIR/hooks/ to .githooks/.