Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Lint

on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true

jobs:
lint:
name: Lint (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: true

- name: Run go mod tidy
run: go mod tidy

- name: Run golangci-lint
run: make lint

- name: Check for uncommitted changes
shell: bash
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Uncommitted changes detected"
git status
git diff
exit 1
fi
48 changes: 24 additions & 24 deletions cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ require (
github.com/grokify/html-strip-tags-go v0.1.0
github.com/jinzhu/copier v0.4.0
github.com/jinzhu/now v1.1.5
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.9
github.com/microcosm-cc/bluemonday v1.0.27
github.com/mozillazg/go-pinyin v0.20.0
Expand Down Expand Up @@ -117,7 +118,6 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
Expand Down
4 changes: 2 additions & 2 deletions internal/base/translator/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ func inspectTranslatorNode(node any, path []string, isRoot bool) error {
return nil
case []any:
for idx, child := range data {
nextPath := append(path, fmt.Sprintf("[%d]", idx))
nextPath := append(path, fmt.Sprintf("[%d]", idx)) //nolint: gocritic
if err := inspectTranslatorNode(child, nextPath, false); err != nil {
return err
}
}
return nil
case []map[string]any:
for idx, child := range data {
nextPath := append(path, fmt.Sprintf("[%d]", idx))
nextPath := append(path, fmt.Sprintf("[%d]", idx)) //nolint: gocritic
if err := inspectTranslatorNode(child, nextPath, false); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion script/check-asf-header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ else
exit 1
fi

$CONTAINER_RUNTIME run -it --rm -v "$(pwd)":/github/workspace ghcr.io/korandoru/hawkeye-native format
$CONTAINER_RUNTIME run --rm -v "$(pwd)":/github/workspace ghcr.io/korandoru/hawkeye-native format

gofmt -w -l .