Skip to content

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

Open
andy-sweet wants to merge 1 commit into
mainfrom
pre-commit
Open

[WIP] Add pre-commit config and installation notes#22
andy-sweet wants to merge 1 commit into
mainfrom
pre-commit

Conversation

@andy-sweet

Copy link
Copy Markdown
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

> three-experiments@0.0.0 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

> three-experiments@0.0.0 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.

@vercel

vercel Bot commented Jan 31, 2024

Copy link
Copy Markdown

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