-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
github PRs: utilize nixpkgs-lint #11265
Comments
This is also covered in #11166. I will try to tackle this in the next days. |
🍰 I know that @mbbx6spp might be working on a linter :) |
For the integration into Github I see the following possibilities:
For all existing solution we would have to implement the integration with @mbbx6spp what are you working on concretely? |
Update: I am currently working on nixpkgs-lint integration into markstory/lint-review. I hope I have some results tomorrow. |
I have lint running on every PR on my personal build server. I've been working to leave feedback on PRs when I notice it reporting a degradation, but it is a bit tricky to detect which package(s) were changed and if the change was for a good / worse. Right now I have it with a diff (a bit hacky...): #!/bin/sh
set -eux
git fetch origin
# $upstream is `master` or `release-15.09`, the branch being merged in to
git checkout "origin/$upstream"
nixpkgs-lint -f . > lint-from-target-branch
git merge "$current_branch"
nixpkgs-lint -f . > lint-from-pr
diff lint-from-target-branch lint-from-pr If there is a good way to determine which packages need to be run against, I'd be happy to improve it and more readily leave feedback. |
I do not have a solution for finding the packages that have changed. However, I do no think that it is necessary to have this information. My current plan is to modify nixpkgs-lint s.t. it prints information about the position of the problem (path to the file and line number) and then append this information to the PR via a tool like lint-review. This looks like
The modification of nixpkgs-lint is nearly done and I will push it in the next ~2 days. I also hope to have enough time to set up lint-review to work with nixpkgs-lint next week. |
@pSub Is this still a work in progress? We can get Travis to run "nixpkgs-lint" but it won't be well formatted. If we can get "lint-review" in nixpkgs, could we have it run on one of the Hydra machines? |
This will run nixpkgs-lint for each travis build. Maybe??? fixes NixOS#11265
Followup to my suggestion on #17458 to only check modified packages. The nixpkgs-lint script needs a package name, so we just need a way to determine which packages have been modified by a commit. This could be done by getting the paths of Nix expressions for modified packages from Only two issues: commits in branches other than master, which would require finding that branch and doing a Adding this to travis-nox-review-pr.sh might work: for line in "$(git diff --numstat HEAD~1 | grep -o 'pkgs/.*\.nix')"
do
nix-shell --packages nixpkgs-lint --run "nixpkgs-lint -f $TRAVIS_BUILD_DIR -p $(grep -o 'name = ".*";' $line | tail -c +9 | head -c -2)"
done |
@pSub Are you closing because it is fixed or because you stopped working on it? Since we have ofborg now, it seems to be more relevant now then when the issue was opened. |
It would be nice if it auto-reminded of missing or bad meta-data. (Follow up from #9966.)
The text was updated successfully, but these errors were encountered: