You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good to enforce minimum standards for earthfiles.
List of Lints:
Restrict repository references to tagged references only.
Ok: github.com/earthly/earthly:v0.1.0+earthly
Bad: github.com/earthly/earthly+earthly
Reason: Using untagged references is fragile and leads to breakage. Upstream packages should not have to worry about downstream consumers being broken by changes.
Maybe look at the Best Practices list for more inspiration.
The easiest way to do this would possibly be use the Official Earthly AST package.
And write a linter that just scans through the AST looking for things we want to check against.
Note, there is already: earthly/earthly#1075 so such a tool may be generally useful.
It may also be best to fork the earthly repo, and add the linter as a tool so that we can try and get it upstreamed.
It may also be easier to just add a --lint option to the official earthly command itself rather than make a new tool.
Most lints would be opinionated like this one, so they should probably be switchable. But for our purposes an initial tool which JUST did this check would be more than enough.
The text was updated successfully, but these errors were encountered:
It would be good to enforce minimum standards for earthfiles.
List of Lints:
github.com/earthly/earthly:v0.1.0+earthly
github.com/earthly/earthly+earthly
The easiest way to do this would possibly be use the Official Earthly AST package.
And write a linter that just scans through the AST looking for things we want to check against.
Note, there is already: earthly/earthly#1075 so such a tool may be generally useful.
It may also be best to fork the earthly repo, and add the linter as a tool so that we can try and get it upstreamed.
It may also be easier to just add a
--lint
option to the official earthly command itself rather than make a new tool.Most lints would be opinionated like this one, so they should probably be switchable. But for our purposes an initial tool which JUST did this check would be more than enough.
The text was updated successfully, but these errors were encountered: