setup lint - #24
Conversation
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This pull request sets up linting infrastructure for the project by adding pre-commit hooks, golangci-lint configuration, and GitHub Actions workflows. It also applies some initial lint fixes to existing files.
Changes:
- Added pre-commit hooks configuration with checks for common issues and golangci-lint integration
- Added golangci-lint configuration file to enforce code quality standards
- Added GitHub Actions workflows for automated linting and CodeQL security scanning
- Applied formatting fixes to README.md and removed unnecessary type declaration in test file
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.pre-commit-config.yaml |
Configures pre-commit hooks for file checks, golangci-lint, and prettier formatting |
.golangci.yml |
Defines golangci-lint configuration with enabled linters and formatters |
.github/workflows/lint-tests.yml |
Adds automated linting workflow that runs on pull requests |
.github/workflows/codeql.yml |
Adds CodeQL security scanning workflow |
.github/workflows/stellar-ledger-data-indexer.yml |
Adds concurrency control to existing workflow |
internal/transform/contract_data_test.go |
Removes unnecessary bool type declaration (lint fix) |
README.md |
Fixes markdown formatting with proper spacing and trailing whitespace |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| formatters: | ||
| enable: |
There was a problem hiding this comment.
The configuration structure appears incorrect. In golangci-lint configuration, formatters are not enabled in this way. The gofmt and goimports are part of the linters, not a separate "formatters" section with an "enable" key. If you want to use these tools, you should include them in the linters.enable section, or configure them separately. The formatters section is not a standard golangci-lint configuration option.
| formatters: | |
| enable: |
| disable: | ||
| - errcheck | ||
| - ineffassign | ||
| - staticcheck |
There was a problem hiding this comment.
The linters configuration has conflicting directives. Setting default: none and then using disable for specific linters doesn't make sense because if default is none, those linters are already not enabled. You should either use enable to explicitly enable linters you want, or remove the disable section. The current configuration is confusing and may not work as intended.
| disable: | |
| - errcheck | |
| - ineffassign | |
| - staticcheck |
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} |
There was a problem hiding this comment.
The concurrency group expression contains invalid syntax. The braces around github.event_name should use ${{ not {{. The correct syntax should be ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-${{ github.event_name }}.
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} | |
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-${{ github.event_name }} |
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} |
There was a problem hiding this comment.
The concurrency group expression contains invalid syntax. The braces around github.event_name should use ${{ not {{. The correct syntax should be ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-${{ github.event_name }}.
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} | |
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-${{ github.event_name }} |
| - cron: "42 15 * * 6" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} |
There was a problem hiding this comment.
The concurrency group expression contains invalid syntax. The braces around github.event_name should use ${{ not {{. The correct syntax should be ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-${{ github.event_name }}.
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} | |
| group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-${{ github.event_name }} |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.