Skip to content

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

Open
ulidtko wants to merge 2 commits intoeli-schwartz:masterfrom
ulidtko:feat/use-namcap-if-present
Open

Call namcap (if present) in pre-commit hook#25
ulidtko wants to merge 2 commits intoeli-schwartz:masterfrom
ulidtko:feat/use-namcap-if-present

Conversation

@ulidtko
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ulidtko force-pushed the feat/use-namcap-if-present branch from cf2af4b to ffe5459 Compare April 29, 2022 13:27
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.

2 participants