Skip to content

[lint-monster] Extract hardcoded file paths to named constants #39935

@github-actions

Description

@github-actions

Summary

Custom linter detected 120 instances of hardcoded file paths across 55 unique files.

Issue

File paths are hardcoded as string literals throughout the codebase. These should be extracted as named constants to:

  • Reduce duplication and maintenance risk
  • Enable centralized path configuration
  • Improve readability and discoverability

Finding Examples

pkg/constants/constants.go:374: hard-coded file path ".github/workflows": consider extracting as a named constant
pkg/workflow/compiler_yaml_main_job.go:611: hard-coded file path "/tmp/gh-aw/agent/": consider extracting as a named constant
pkg/cli/add_package_manifest.go:33: hard-coded file path ".github/workflows": consider extracting as a named constant

Most Common Paths

  • .github/ (22 instances) – repository workflow definitions
  • /tmp/gh-aw/ (13 instances) – temporary runtime directories
  • .github/workflows/ (11 instances) – workflow files
  • /tmp/gh-aw/aw-prompts/prompt.txt (9 instances)
  • ${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json (4 instances)

Affected Subsystems

  • pkg/constants/ – centralized constants definition
  • pkg/workflow/ (30+ files) – workflow compilation and execution
  • pkg/cli/ (15 files) – CLI commands
  • pkg/parser/ (10 files) – workflow parsing

Remediation Steps

  1. Add missing path constants to pkg/constants/constants.go
  2. Replace hardcoded string literals with constant references
  3. Group related paths into a logical constants file section
  4. Run make golint-custom to validate

Acceptance Criteria

  • All 120 hardcoded path instances remediated
  • New constants documented with clear purpose
  • No string literals for paths remain

Generated by 🧌 LintMonster ·

  • expires on Jun 24, 2026, 4:57 PM UTC-08:00

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions