Skip to content

Commit 702393d

Browse files
committed
docs: Update CONTRIBUTING with husky directions
1 parent 1c170b6 commit 702393d

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ Note: Understanding how git remotes work will make collaborating much easier. Yo
137137

138138
- _Please note that the `ports` for the frontend and backend are set in this location_
139139

140+
1. Set up Husky for Git hooks (required for all contributors):
141+
142+
To help enforce code quality and prevent errors from being committed, we use [Husky](https://typicode.github.io/husky/) to manage Git hooks. Husky should install itself automatically after you install dependencies (thanks to the `prepare` script in `package.json`).
143+
144+
If you notice that Git hooks are not working (for example, you don't see linting or formatting checks when committing), you may need to set up Husky manually. To do this, run the following in the root of the project:
145+
146+
```sh
147+
npx husky install
148+
```
149+
150+
If you encounter issues, see the [Husky documentation](https://typicode.github.io/husky/#/) or reach out on Slack!
151+
140152
1. Take a second to review the `app.js` and `server.js` files in the `vrms/backend` folder. These two files are a blueprint for the back end, so please familiarize yourself with it. You'll see folders for the database collection models, routes for the API, and a config file which loads the necessary environment variables.
141153

142154
1. Start the local development servers (frontend & backend).
@@ -211,13 +223,20 @@ You will create a new branch for each issue you work on. Doing all your work on
211223
git checkout -b your-branch-name
212224
```
213225

214-
### **3.2.1 Check for and resolve code errors before making changes**
226+
### **3.2.1 Check for and resolve linting/prettier errors before making changes**
215227

216228
Before you begin working on any part of a file, always check for existing code errors in the codebase. This helps prevent introducing new issues and ensures a stable foundation for your work.
217229

218-
- Use your code editor's error checking tools or run the appropriate linting/compilation commands (e.g., `yarn lint`, `npm run lint`, or your IDE's error panel) to identify any errors in the files you plan to edit.
219-
- Resolve any errors you find before proceeding with your changes. If you are unsure how to fix an error, ask for help in the team Slack channel or consult the documentation.
230+
- Use your code editor's error checking tools or run the appropriate linting/compilation commands (e.g., `yarn lint (filename)`, or your IDE's error panel) to identify any errors in the files you plan to edit. (This isn't your fault, it's just an old codebase 🤷‍️)
231+
- If you find errors, resolve them in a **separate commit** before starting your feature or fix work. Use a clear commit message such as:
232+
233+
> fix: Resolve existing linting and compilation errors
234+
235+
(This makes it easier for reviewers to distinguish between error fixes and your new changes.)
236+
237+
- If you are unsure how to fix an error, ask for help in the team Slack channel or consult the documentation.
220238
- Only begin implementing new features or fixes after confirming the file is error-free.
239+
- If you are unable to resolve the errors after making a reasonable effort, it is acceptable to use `--no-verify` when committing or pushing your changes. Please leave a comment in your pull request explaining why this was necessary.
221240

222241
### **3.3 Work on the Issue**
223242

0 commit comments

Comments
 (0)