Skip to content
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

🛠️ [TASK] : Earthfile linting #9

Open
2 tasks
Tracked by #168
stevenj opened this issue Sep 25, 2023 · 0 comments
Open
2 tasks
Tracked by #168

🛠️ [TASK] : Earthfile linting #9

stevenj opened this issue Sep 25, 2023 · 0 comments
Labels
ci/cd CI/CD Fixes or Improvements.

Comments

@stevenj
Copy link
Collaborator

stevenj commented Sep 25, 2023

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.

@stevenj stevenj added this to Catalyst Sep 25, 2023
@stevenj stevenj added the ci/cd CI/CD Fixes or Improvements. label Sep 25, 2023
@minikin minikin moved this to 📋 Backlog in Catalyst Sep 27, 2023
@stevenj stevenj changed the title Earthfile linting 🛠️ [TASK] : Earthfile linting Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd CI/CD Fixes or Improvements.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant