This repository was archived by the owner on May 20, 2024. It is now read-only.
Commit ed88f16 1 parent 759d09b commit ed88f16 Copy full SHA for ed88f16
File tree 4 files changed +29
-5
lines changed
4 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,13 @@ repos:
16
16
- id: cspell
17
17
args: [--config, " ./cspell.json" ]
18
18
19
- - repo: https://github.com/golangci/golangci-lint
20
- rev: v1.55.2
19
+ - repo: local
21
20
hooks:
22
21
- id: golangci-lint
22
+ name: golangci-lint
23
+ entry: sh -c ' cd api/ && docker build --target lint -t nfc-entry-management-api-lint:latest -f ./Dockerfile . && docker run --rm nfc-entry-management-api-lint:latest'
24
+ language: system
25
+ types: [go]
23
26
24
27
- repo: local
25
28
hooks:
Original file line number Diff line number Diff line change
1
+ linters :
2
+ enable-all : false
3
+ disable-all : false
4
+ fast : false
Original file line number Diff line number Diff line change 1
- FROM golang:1.21.6-alpine
1
+ FROM golang:1.21.6-alpine AS base
2
2
3
3
WORKDIR /app
4
4
@@ -9,3 +9,19 @@ RUN apk add --no-cache git && \
9
9
go install -v golang.org/x/tools/gopls@latest
10
10
11
11
RUN go mod tidy
12
+
13
+ ENV PATH="/app/bin:${PATH}"
14
+
15
+ # development stage
16
+ FROM base AS development
17
+
18
+ RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2
19
+
20
+ # ENV PATH="/root/go/bin:${PATH}"
21
+
22
+ # lint stage
23
+ FROM development AS lint
24
+
25
+ COPY .golangci.yml .
26
+
27
+ CMD [ "golangci-lint" ,"run" ]
Original file line number Diff line number Diff line change 1
1
services :
2
2
api :
3
- container_name : nfc-entry-management-api
4
- image : nfc-entry-management-api:latest
3
+ container_name : nfc-entry-management-api-development
4
+ image : nfc-entry-management-api-development :latest
5
5
build :
6
6
context : ./api
7
7
dockerfile : Dockerfile
8
+ target : development
8
9
volumes :
9
10
- ./api/src:/app
10
11
ports :
You can’t perform that action at this time.
0 commit comments