Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
Scaffolds the logsLinter Go analyzer repository with an initial analyzer skeleton, rule/extraction logic (with tests), and baseline repo automation (CI, security scanning, dependency review, templates, and docs) to support ongoing development.
Changes:
- Added initial analyzer package (
internal/analyzer) with message extraction + rule checks and accompanying unit tests. - Added CLI entrypoint (
cmd/logslinter) and initialized the Go module and dependencies. - Introduced repo automation/tooling: GitHub Actions workflows, Dependabot, golangci-lint configs, templates, and security/docs files.
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
internal/analyzer/analyzer.go |
Defines exported analysis.Analyzer scaffold and Run hook. |
internal/analyzer/extract.go |
Implements AST-based extraction of literal/concatenated log message strings. |
internal/analyzer/extract_test.go |
Unit tests for message extraction behavior. |
internal/analyzer/rules.go |
Defines rule IDs/messages and rule evaluation/check implementations. |
internal/analyzer/rules_test.go |
Unit tests covering the initial rule behaviors. |
cmd/logslinter/main.go |
Wires analyzer into a singlechecker CLI binary. |
go.mod |
Initializes module + Go version + dependencies. |
go.sum |
Adds dependency checksums. |
README.md |
Project overview, goals, planned rules, and dev commands. |
SECURITY.md |
Security reporting policy and expectations. |
docs/github-ruleset.md |
Suggested GitHub ruleset and required checks. |
.golangci.repo.yml |
Repo lint configuration for CI (vet/staticcheck/etc + gofmt). |
.golangci.yml |
End-user golangci-lint config enabling the custom linter plugin. |
.custom-gcl.yml |
Local custom golangci-lint build/plugin registration config. |
.editorconfig |
Formatting defaults for Go/Markdown/YAML and Makefiles. |
.gitignore |
Ignores build outputs and local tooling/context artifacts. |
.github/workflows/ci.yml |
CI for formatting, vet, test, build, and repo linting. |
.github/workflows/actionlint.yml |
Lints GitHub Actions workflows. |
.github/workflows/codeql.yml |
CodeQL analysis workflow for Go. |
.github/workflows/dependency-review.yml |
Dependency review workflow for PRs. |
.github/dependabot.yml |
Dependabot configuration for Go modules and GitHub Actions. |
.github/pull_request_template.md |
PR template with verification/checklist items. |
.github/ISSUE_TEMPLATE/bug_report.yml |
Bug report issue template. |
.github/ISSUE_TEMPLATE/feature_request.yml |
Feature request issue template. |
.github/ISSUE_TEMPLATE/config.yml |
Issue template config + security contact link. |
.github/actionlint.yaml |
actionlint configuration. |
.github/CODEOWNERS |
Establishes default code ownership. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| version: v2.11.2 | ||
| name: custom-golangci-lint |
There was a problem hiding this comment.
Local custom-golangci-lint is pinned to v2.11.2, while CI runs golangci-lint v2.1. If both are meant to be used for the same checks, this drift can cause "works locally, fails in CI" behavior; consider pinning a single version or documenting why they differ.
| - name: Lint repository code | ||
| uses: golangci/golangci-lint-action@v8 | ||
| with: | ||
| version: v2.1 | ||
| args: --config=.golangci.repo.yml |
There was a problem hiding this comment.
CI pins golangci-lint to v2.1, but .custom-gcl.yml pins the local custom binary to v2.11.2. Consider keeping these versions in sync (or documenting the reason for divergence) to avoid inconsistent lint results between local runs and CI.
| module github.com/rTexty/logsLinter | ||
|
|
There was a problem hiding this comment.
The module path uses mixed case (github.com/rTexty/logsLinter). Go module paths are case-sensitive, and mixed-case paths can lead to confusing import / go get mismatches (especially on case-insensitive filesystems). Consider switching the module path to all-lowercase to avoid these issues long-term.
| # logsLinter | ||
|
|
||
| [](https://github.com/rTexty/logsLinter/actions/workflows/ci.yml) | ||
| [](https://github.com/rTexty/logsLinter/actions/workflows/codeql.yml) |
There was a problem hiding this comment.
README describes the project as "Production-ready", but the analyzer Run currently returns nil, nil and the Status section says the repo is still being scaffolded. Consider adjusting the top-level description to avoid setting incorrect expectations until the analyzer is functional.
|
|
||
| go 1.24.0 | ||
|
|
There was a problem hiding this comment.
The go directive includes a patch version (go 1.24.0), but go.mod only allows major.minor (e.g., go 1.24). As written, go mod / go test will fail to parse the module file.
| - Catch non-English or non-ASCII log text | ||
| - Flag decorative punctuation and emoji in log messages | ||
| - Prevent accidental logging of potentially sensitive data | ||
| - Integrate with standard Go analysis tooling and `golangci-lint` |
There was a problem hiding this comment.
README states the project requires Go 1.23+, but go.mod targets Go 1.24 (and CI uses go-version-file: go.mod). Align the documented minimum Go version with the module/tooling so contributors don't use an unsupported version.
| const ( | ||
| msgLowercaseStart = "log message must start with a lowercase letter" | ||
| msgASCIIOnly = "log message must be in English (ASCII only)" |
There was a problem hiding this comment.
msgLowercaseStart says the message "must start with a lowercase letter", but the rule implementation intentionally allows non-letter prefixes (e.g., digits) and empty strings. This makes diagnostics misleading; consider rewording to something like "if the message starts with a letter, it must be lowercase" (or tighten the rule to match the current wording).
| msgASCIIOnly = "log message must be in English (ASCII only)" | ||
| msgNoSpecialChars = "log message must not contain special characters or emoji" | ||
| msgSensitiveData = "log message may contain sensitive data" | ||
| ) |
There was a problem hiding this comment.
msgNoSpecialChars claims the message must not contain special characters or emoji, but checkNoSpecialCharsOrEmoji only checks for !, ..., and a trailing ? (plus emoji). Either broaden the check to match the message or narrow the message so users understand what's actually prohibited.
3257f67 to
bb01838
Compare
This pull request scaffolds the repository for the
logsLinterGo analyzer project, establishing initial project structure, development tooling, repository automation, and documentation. The changes set up code linting, CI workflows, issue templates, and essential configuration files to support development and contribution best practices.Repository automation and CI/CD setup:
ci.yml), workflow linting (actionlint.yml), CodeQL security analysis (codeql.yml), and dependency review (dependency-review.yml). Dependabot is configured to track Go modules and GitHub Actions dependencies. [1] [2] [3] [4] [5].golangci.repo.ymland.golangci.ymlfor repository and custom linter configuration, and.custom-gcl.ymlto register the customlogsLinterplugin. [1] [2] [3]Development and contribution guidelines:
README.mdwith project goals, planned rules, and development instructions, as well as aSECURITY.mdand a GitHub branch protection/ruleset recommendation document. [1] [2] [3]Project structure and configuration:
go.mod) and entrypoint for the analyzer (cmd/logslinter/main.go). [1] [2]These changes provide a solid foundation for developing, testing, and maintaining the
logsLinteranalyzer in a collaborative and automated environment.