Copilot commented on code in PR #269:
URL: https://github.com/apache/skywalking-eyes/pull/269#discussion_r3036767083


##########
.github/workflows/lint.yaml:
##########
@@ -0,0 +1,44 @@
+name: Lint
+
+on:
+  pull_request:
+    branches: [ main ]
+

Review Comment:
   This new workflow file is missing the Apache ASF license header block that 
other workflows in this repo include (e.g., 
`.github/workflows/license-eye-check.yaml`, `publish-docker.yaml`). Add the 
standard header comment at the top to keep licensing consistent across workflow 
files.



##########
.github/workflows/lint.yaml:
##########
@@ -0,0 +1,44 @@
+name: Lint
+
+on:
+  pull_request:
+    branches: [ main ]
+
+jobs:
+  lint:
+    name: Markdown and Go
+    runs-on: ubuntu-latest
+    permissions:
+      # Required: allow read access to the content for analysis.
+      contents: read
+    steps:
+
+    - name: Check out code into the Go module directory
+      uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+    - name: Set up Go
+      uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
+      with:
+        go-version-file: go.mod
+
+    - name: Go formatting
+      run: |
+        if [ -z "$(gofmt -l .)" ]; then
+          echo -e "All '*.go' files are properly formatted."
+        else
+          echo -e "Please run 'make lint' to fix. Some files need formatting:"
+          gofmt -d -l .
+          exit 1
+        fi
+
+    - name: Read golangci-lint version from Makefile
+      id: lint-version
+      run: echo "version=$(grep -oP 'GOLANGCI_LINT_VERSION\s*=\s*\K\S+' 
Makefile)" >> $GITHUB_OUTPUT
+
+    # 
https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#verify
+    - name: Verify linter configuration and Lint go code
+      uses: 
golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
+      with:
+        verify: true
+        args: --timeout=30m
+        version: ${{ steps.lint-version.outputs.version }}

Review Comment:
   `steps` list items are indented at the same level as `steps:` (e.g., line 
16), which makes this workflow invalid YAML and prevents the job from running. 
Indent each `- name:` entry (and its children) two more spaces so they are 
nested under `steps:` (consistent with the other workflows in this repo).
   ```suggestion
         - name: Check out code into the Go module directory
           uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 
v6.0.2
   
         - name: Set up Go
           uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # 
v6.4.0
           with:
             go-version-file: go.mod
   
         - name: Go formatting
           run: |
             if [ -z "$(gofmt -l .)" ]; then
               echo -e "All '*.go' files are properly formatted."
             else
               echo -e "Please run 'make lint' to fix. Some files need 
formatting:"
               gofmt -d -l .
               exit 1
             fi
   
         - name: Read golangci-lint version from Makefile
           id: lint-version
           run: echo "version=$(grep -oP 'GOLANGCI_LINT_VERSION\s*=\s*\K\S+' 
Makefile)" >> $GITHUB_OUTPUT
   
         # 
https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#verify
         - name: Verify linter configuration and Lint go code
           uses: 
golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
           with:
             verify: true
             args: --timeout=30m
             version: ${{ steps.lint-version.outputs.version }}
   ```



##########
.github/workflows/lint.yaml:
##########
@@ -0,0 +1,44 @@
+name: Lint
+
+on:
+  pull_request:
+    branches: [ main ]
+
+jobs:
+  lint:
+    name: Markdown and Go

Review Comment:
   Job name `Markdown and Go` is misleading here: this workflow only runs gofmt 
+ golangci-lint and doesn’t lint Markdown files. Rename the job (or add a 
Markdown linter step) to keep the workflow intent clear.
   ```suggestion
       name: Go
   ```



##########
.github/workflows/lint.yaml:
##########
@@ -0,0 +1,44 @@
+name: Lint
+
+on:
+  pull_request:
+    branches: [ main ]
+
+jobs:
+  lint:
+    name: Markdown and Go
+    runs-on: ubuntu-latest
+    permissions:
+      # Required: allow read access to the content for analysis.
+      contents: read
+    steps:
+
+    - name: Check out code into the Go module directory
+      uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+    - name: Set up Go
+      uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
+      with:
+        go-version-file: go.mod
+
+    - name: Go formatting
+      run: |
+        if [ -z "$(gofmt -l .)" ]; then
+          echo -e "All '*.go' files are properly formatted."
+        else
+          echo -e "Please run 'make lint' to fix. Some files need formatting:"

Review Comment:
   The gofmt failure message says to run `make lint`, but `make lint` only runs 
golangci-lint (the Makefile has no gofmt target), so it won’t necessarily fix 
formatting issues. Update the message to instruct running gofmt (or add/use an 
existing make target that formats code) so developers get the correct 
remediation guidance.
   ```suggestion
             echo -e "Please run 'gofmt -w .' to fix formatting. Some files 
need formatting:"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to