Skip to content

feat: decoding improvements #2068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 22, 2025
Merged

feat: decoding improvements #2068

merged 11 commits into from
Feb 22, 2025

Conversation

pd93
Copy link
Member

@pd93 pd93 commented Feb 17, 2025

These changes came from investigating #2065. This PR does not fix that issue (I will do that in a follow up PR), but it did uncover a few problems which I've addressed here:

  • Refactored how snippets work
    • Moved from errors package to taskfile package (now part of the package API)
    • Functional options
    • Support for out-of-bounds lines/columns
    • Ability to hide the line/column indicators
    • A bunch of tests
  • Added a debug function for TaskfileDecodeError. This was just helpful to track down the next issue
  • Fixed the ast.Cmd Unmarshaler so that errors are correctly propagated to the user.
    • This is what is causing the unhelpful error in Allow to use vars in matrix #2065.
    • It should now return something like: err: cannot unmarshal !!map into []interface {} which much more accurately describes the problem.
  • Fixed the Taskfile schema for defer statements when used in the shorthand commands array syntax

Copy link
Member

@vmaerten vmaerten left a comment

Choose a reason for hiding this comment

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

Way cleaner
I like the fact you splitted defer into another file!

@pd93 pd93 merged commit cdb6a3f into main Feb 22, 2025
14 checks passed
@pd93 pd93 deleted the decoding-improvements branch February 22, 2025 15:44
pd93 added a commit that referenced this pull request Feb 22, 2025
@pd93 pd93 added the area: package api Changes related to the usage of Task as a Go package. label Feb 23, 2025
@pd93 pd93 linked an issue Mar 17, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: package api Changes related to the usage of Task as a Go package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

YAML schema does not recognize silent attribute for defer blocks
2 participants