Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add pre-commit config and installation notes #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andy-sweet
Copy link
Collaborator

This adds a pre-commit config file to the repo, so that contributors can run those hooks locally automatically when committing.

The configs are lifted from the cryoet-data-portal repo.

I chose pre-commit (over something more JS like husky) because I have some familiarity with it and because it's plausible we might have some other languages in this repo (e.g. Python for generating synthetic data, converting real data, or hosting local files).

Here's some console output when making a change with broken formatting

(zebrahub-demo) ➜  points-web-viewer git:(pre-commit) ✗ git add src
(zebrahub-demo) ➜  points-web-viewer git:(pre-commit) ✗ git commit 
npm lint.................................................................Failed
- hook id: npm-lint
- exit code: 1

> [email protected] lint
> eslint src


/Users/asweet/projects/points-web-viewer/src/PointCanvas.ts
  35:18  error  Insert `;`         prettier/prettier
  35:18  error  Missing semicolon  semi

✖ 2 problems (2 errors, 0 warnings)
  2 errors and 0 warnings potentially fixable with the `--fix` option.


npm run format...........................................................Failed
- hook id: npm-format
- files were modified by this hook

> [email protected] format
> prettier --write src

src/app.css 29ms (unchanged)
src/app.tsx 201ms (unchanged)
src/index.css 8ms (unchanged)
src/main.tsx 6ms (unchanged)
src/PointCanvas.ts 56ms
src/PointSelectionBox.ts 48ms (unchanged)
src/scene.tsx 40ms (unchanged)

(zebrahub-demo) ➜  points-web-viewer git:(pre-commit) ✗ git add src
(zebrahub-demo) ➜  points-web-viewer git:(pre-commit) ✗ git commit 
npm lint.................................................................Passed
npm run format...........................................................Passed
Aborting commit due to empty commit message.

Copy link

vercel bot commented Jan 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
points-web-viewer ✅ Ready (Inspect) Visit Preview Jan 31, 2024 0:08am

@andy-sweet andy-sweet changed the title Add pre-commit config and installation notes [WIP] Add pre-commit config and installation notes Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant