这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@walteh
Copy link
Owner

@walteh walteh commented Aug 5, 2025

Summary

  • discover Taskfile.hcl and extensionless Taskfile names
  • wire up an HCL loader stub and hook discovery into it
  • mention HCL in CLI help and completions

Testing

  • go test ./taskfile
  • go run ./cmd/task -d /tmp/hcltest (fails: HCL parsing not implemented)

Prompt

Task 2: Extend Taskfile Discovery to HCL Files

Purpose: Allow the tool to recognize HCL-based Taskfiles. We will update the Taskfile search logic to include Taskfile.hcl (and an extensionless Taskfile) as valid config filenames, in addition to the existing YAML names. The code should detect these new filenames and route to the appropriate parser.
• Implementation:
• Modify the supported file names list (in the code that searches for Taskfiles) to include Taskfile.hcl and Taskfile (as well as lowercase variants for consistency, if applicable). The search order should be defined to avoid ambiguity when multiple formats are present. For initial implementation, you can list HCL files after the YAML files so that existing projects are not impacted (e.g. check YAML first, then HCL).
• Update any logic that prints the expected Taskfile name or checks for default filenames. For example, if an error says “Taskfile not found”, it should mention .hcl as well.
• For now, if an HCL file is found, call the HCL loader (from Task 1’s interface). If the HCL loader is not yet fully implemented, have it return a descriptive “not implemented” error. This allows incremental development without breaking the program flow.
• Validation:
• Write tests for the discovery logic. Example: create temp files Taskfile.hcl and Taskfile.yml in a directory and ensure the program finds the correct one according to the priority. Test that if only Taskfile.hcl exists, the loader is invoked (even if it errors out for now).
• Run the task command in a directory with an HCL Taskfile (containing minimal content like just a version) and verify that the program attempts to load it. It may error until HCL parse is implemented, but the error message should clearly indicate HCL is recognized (e.g. “HCL parsing not implemented” rather than “file not found”).


https://chatgpt.com/codex/tasks/task_e_6891fda49e7c8330bc713c77ca2d0502

@walteh walteh merged commit 85af1bf into codex/hcl Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants