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

Add package lint tool #12

Open
raisjn opened this issue Sep 5, 2020 · 7 comments
Open

Add package lint tool #12

raisjn opened this issue Sep 5, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@raisjn
Copy link
Contributor

raisjn commented Sep 5, 2020

it would be nice to lint packages for correctness.

things like:

  • are you installing binaries into /opt?
  • are you installing any files into / that are more than X in size?
@matteodelabre

This comment has been minimized.

@Eeems

This comment has been minimized.

@fenollp
Copy link

fenollp commented Oct 7, 2020

Sounds like this needs a configuration language, not an effectfull programming language.

I'm not sure what the constraints of toltec are but if you want to stay with shell, maybe shellcheck should at least be part of the linting. Maybe it can even be tuned to verify new things you need? My 2 cents.

@Eeems
Copy link
Member

Eeems commented Oct 7, 2020

Sounds like this needs a configuration language, not an effectfull programming language.

I'm not sure what the constraints of toltec are but if you want to stay with shell, maybe shellcheck should at least be part of the linting. Maybe it can even be tuned to verify new things you need? My 2 cents.

We do actually have shellcheck running in the linting right now, but it can't lint the non-shell specific stuff we have in the package definition itself. That requires context of the system that shellcheck doesn't have.

@matteodelabre
Copy link
Member

Sounds like this needs a configuration language, not an effectfull programming language.

The good side of this choice is that we can use the metadata fields inside the recipe functions, e.g. to parameterize sources with the version number. This is the model that Arch Linux uses. But of course we can transition to something else if it is warranted.

I'm not sure what the constraints of toltec are but if you want to stay with shell, maybe shellcheck should at least be part of the linting. Maybe it can even be tuned to verify new things you need? My 2 cents.

shfmt has a -tojson flag which exports the internal AST. We could repurpose that to check project-specific syntax constraints.

@matteodelabre
Copy link
Member

matteodelabre commented Jan 13, 2021

Check that:

@matteodelabre
Copy link
Member

  • Packages do not install conflicting files.
  • Increases in upstream version numbers implies increased timestamp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants