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

Call namcap (if present) in pre-commit hook #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ulidtko
Copy link

@ulidtko ulidtko commented Apr 29, 2022

namcap is a linter for PKGBUILD's and also built .tar.xz packages. Similar to lintian for .deb packages.

I figure, pre-commit hook is a good place to call it (if it's installed) automatically.

Please review & merge.

ulidtko added a commit to ulidtko/aurpublish that referenced this pull request Apr 29, 2022
@alerque
Copy link
Contributor

alerque commented Apr 29, 2022

I would highly recommend you modify your own workflow to use makechrootpkg instead of makepkg. You'll get namcap linting and other checks as part of the deal. If you want to manage packages well building them in a chroot as is mandated for official repositories is the only way to verify that you have your dependencies worked out and don't just happen to have stuff leaking in from your host system. The fact that it runs lints on the results is just a bonus.

@alerque
Copy link
Contributor

alerque commented Apr 29, 2022

Also the output of namcap is hardly authoritative (I say this as one of the upstream maintainers). For example it may return an error for missing dependencies in -debug packages that are not valid (but there are quite a few other false positive error scenarios).

I absolutely recommend running it, but blocking progress on a bad exit code would be a mistake, the output needs to be reviewed by hand. At least at this point—if you want to contribute to namecap to the point where it's output could be considered canonical that would be great.

@ulidtko
Copy link
Author

ulidtko commented Apr 29, 2022

Hey @alerque thanks, I'll try makechrootpkg, I understand why it's needed in general — though in my case, dependencies are pre-set by a generating tool which translates known-correct dependencies from language-specific packaging to PKGBUILD. Also I push to AUR, not official repos (at least, yet).

The exit 1 mistake acknowledged, will fix in a minute. Thanks for review!

ulidtko added a commit to ulidtko/aurpublish that referenced this pull request Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants