Skip to content

Commit

Permalink
Added husky for pre committing. (huggingface#1320)
Browse files Browse the repository at this point in the history
* feat: husky

* husky pre commit linting

* casing docker

* move husky to deps

---------

Co-authored-by: Nathan Sarrazin <sarrazin.nathan@gmail.com>
  • Loading branch information
krakenftw and nsarrazin authored Jul 16, 2024
1 parent 3cd7e6a commit 992fe43
Show file tree
Hide file tree
Showing 5 changed files with 603 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .husky/lint-stage-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix", "eslint"],
"*.json": ["prettier --write"],
};
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set -e
npx lint-staged --config ./.husky/lint-stage-config.js
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ARG INCLUDE_DB=false

# stage that install the dependencies
FROM node:20 as builder-production
FROM node:20 AS builder-production

WORKDIR /app

Expand All @@ -13,7 +13,7 @@ RUN --mount=type=cache,target=/app/.npm \
npm set cache /app/.npm && \
npm ci --omit=dev

FROM builder-production as builder
FROM builder-production AS builder

ARG APP_BASE=
ARG PUBLIC_APP_COLOR=blue
Expand All @@ -28,13 +28,13 @@ COPY --link --chown=1000 . .
RUN npm run build

# mongo image
FROM mongo:latest as mongo
FROM mongo:latest AS mongo

# image to be used if INCLUDE_DB is false
FROM node:20-slim as local_db_false
FROM node:20-slim AS local_db_false

# image to be used if INCLUDE_DB is true
FROM node:20-slim as local_db_true
FROM node:20-slim AS local_db_true

RUN apt-get update
RUN apt-get install gnupg curl -y
Expand All @@ -46,7 +46,7 @@ RUN mkdir -p /data/db
RUN chown -R 1000:1000 /data/db

# final image
FROM local_db_${INCLUDE_DB} as final
FROM local_db_${INCLUDE_DB} AS final

# build arg to determine if the database should be included
ARG INCLUDE_DB=false
Expand Down
Loading

0 comments on commit 992fe43

Please sign in to comment.