Skip to content

[lint-monster] lint-monster: Hard-coded File Paths #40211

Description

@github-actions

Hard-coded File Paths

Summary: 16 custom linter findings for hard-coded file path strings that should use defined constants.

Affected Files & Constants:

  • pkg/cli/add_package_manifest.go (13 instances):
    • Line 33: ".github/workflows" → constants.WorkflowsDir
    • Lines 499,504,505,513,518,519,623,645: ".github/" → constants.GithubDir
    • Lines 758,761,765: ".github/workflows/" → constants.WorkflowsDirSlash
  • pkg/workflow/opencode_engine.go:163 - "/tmp/gh-aw/aw-prompts/prompt.txt" → constants.AwPromptsFile
  • pkg/cli/audit.go:1104 - ".github/" → constants.GithubDir
  • pkg/cli/audit_comparison.go:516 - ".github/" → constants.GithubDir
  • pkg/cli/experiments_command.go:366 - ".github/workflows/" → constants.WorkflowsDirSlash
  • pkg/cli/fetch.go:125 - ".github/workflows/" → constants.WorkflowsDirSlash
  • pkg/cli/firewall_policy.go:466 - "/tmp/gh-aw/sandbox/firewall/audit" → constants.AWFAuditDir

Expected Outcome: All hard-coded paths replaced with constants, consistent path handling.

Remediation Checklist:

  • Replace all hard-coded paths in add_package_manifest.go with appropriate constants
  • Replace hard-coded path in opencode_engine.go with constants.AwPromptsFile
  • Replace hard-coded paths in audit.go, audit_comparison.go with constants.GithubDir
  • Replace hard-coded paths in experiments_command.go, fetch.go with constants.WorkflowsDirSlash
  • Replace hard-coded path in firewall_policy.go with constants.AWFAuditDir
  • Verify with make golint-custom

Generated by 🧌 LintMonster · 14.1 AIC · ⌖ 8.84 AIC · ⊞ 4.7K ·

  • expires on Jun 25, 2026, 7:51 PM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions