Skip to content

setup lint - #24

Merged
amishas157 merged 5 commits into
mainfrom
patch/add-linting
Jan 27, 2026
Merged

setup lint#24
amishas157 merged 5 commits into
mainfrom
patch/add-linting

Conversation

@amishas157

Copy link
Copy Markdown
Contributor

No description provided.

@amishas157
amishas157 marked this pull request as ready for review January 27, 2026 04:32
Copilot AI review requested due to automatic review settings January 27, 2026 04:32
@github-advanced-security

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .golangci.yml
Comment on lines +12 to +14

formatters:
enable:

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
formatters:
enable:

Copilot uses AI. Check for mistakes.
Comment thread .golangci.yml
Comment on lines +4 to +7
disable:
- errcheck
- ineffassign
- staticcheck

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
disable:
- errcheck
- ineffassign
- staticcheck

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/codeql.yml Outdated
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.
- cron: "42 15 * * 6"

concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@amishas157
amishas157 merged commit f40a8e2 into main Jan 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants