Fix wsl_v5 lint errors and enforce lint on PR CI
Add missing blank lines around if-block boundaries in two files to satisfy wsl_v5, and make lint-go and lint-js fail the build on pull requests (not only on push to main) by always running the strict lint and using reviewdog purely for inline annotations. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
27
.github/workflows/make.yaml
vendored
27
.github/workflows/make.yaml
vendored
@@ -274,15 +274,14 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- name: "Run golangci-lint"
|
- name: "Run golangci-lint"
|
||||||
|
run: golangci-lint run ./...
|
||||||
|
- name: "Annotate PR with golangci-lint findings"
|
||||||
|
if: failure() && github.event_name == 'pull_request'
|
||||||
env:
|
env:
|
||||||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
golangci-lint run --out-format=line-number ./... 2>&1 | \
|
||||||
golangci-lint run --out-format=line-number ./... 2>&1 | \
|
reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -name="golangci-lint" || true
|
||||||
reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -fail-level=error -name="golangci-lint"
|
|
||||||
else
|
|
||||||
golangci-lint run ./...
|
|
||||||
fi
|
|
||||||
|
|
||||||
lint-js:
|
lint-js:
|
||||||
name: "lint-js"
|
name: "lint-js"
|
||||||
@@ -302,18 +301,16 @@ jobs:
|
|||||||
- name: "Generate Relay artifacts"
|
- name: "Generate Relay artifacts"
|
||||||
run: make relay
|
run: make relay
|
||||||
- name: "Run eslint"
|
- name: "Run eslint"
|
||||||
|
run: npm run lint
|
||||||
|
- name: "Annotate PR with eslint findings"
|
||||||
|
if: failure() && github.event_name == 'pull_request'
|
||||||
env:
|
env:
|
||||||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
for dir in apps/console apps/trust packages/ui packages/eslint-config; do
|
||||||
for dir in apps/console apps/trust packages/ui packages/eslint-config; do
|
(cd "$dir" && npx eslint . --concurrency 4 --format stylish 2>/dev/null) | \
|
||||||
(cd "$dir" && npx eslint . --concurrency 4 --format stylish 2>/dev/null) | \
|
reviewdog -f=eslint -reporter=github-pr-review -filter-mode=nofilter -name="eslint ($dir)" || true
|
||||||
reviewdog -f=eslint -reporter=github-pr-review -filter-mode=nofilter -fail-level=error -name="eslint ($dir)"
|
done
|
||||||
done
|
|
||||||
(cd packages/n8n-node && npx n8n-node lint)
|
|
||||||
else
|
|
||||||
npm run lint
|
|
||||||
fi
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: "test"
|
name: "test"
|
||||||
|
|||||||
@@ -1421,6 +1421,7 @@ WHERE
|
|||||||
return ErrResourceInUse
|
return ErrResourceInUse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("cannot delete profile: %w", err)
|
return fmt.Errorf("cannot delete profile: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2574,6 +2574,7 @@ func (r *Resolver) RemoveUserTool(ctx context.Context, req *mcp.CallToolRequest,
|
|||||||
if _, ok := errors.AsType[*iam.ErrLastActiveOwner](err); ok {
|
if _, ok := errors.AsType[*iam.ErrLastActiveOwner](err); ok {
|
||||||
return nil, types.RemoveUserOutput{}, fmt.Errorf("cannot remove last active owner: %w", err)
|
return nil, types.RemoveUserOutput{}, fmt.Errorf("cannot remove last active owner: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if errors.Is(err, coredata.ErrResourceInUse) {
|
if errors.Is(err, coredata.ErrResourceInUse) {
|
||||||
return nil, types.RemoveUserOutput{}, fmt.Errorf("cannot remove user: %w", err)
|
return nil, types.RemoveUserOutput{}, fmt.Errorf("cannot remove user: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user