-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
maintainers/scripts: Lint check-maintainer-github-handles.sh #147424
Conversation
@@ -62,5 +61,3 @@ export -f checkUser | |||
nix-instantiate -A lib.maintainers --eval --strict --json \ | |||
| jq -r '.[]|.github|select(.)' \ | |||
| parallel -j5 checkUser | |||
|
|||
# parallel -j100 checkUser ::: "eelco" "profpatsch" "Profpatsch" "a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should probably be kept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can explain why, I could include that in the comment. As it stands, I feel like that just looks like accidentally committed test code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is when you want to manually check only a few users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documented, cheers.
Avoids masking return values <https://github.com/koalaman/shellcheck/wiki/SC2155>.
Should detect any errors earlier.
8b09d8c
to
6c09f1e
Compare
|
||
# nixpkgs='<nixpkgs>' | ||
# if [ -n "$1" ]; then | ||
set -o errexit -o noclobber -o nounset -o pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is so explicit that most people will not know what this means. I guess:
errexit is -e and nounset is -u?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is so explicit that most people will not know what this means.
That sentence doesn't make sense to me:
- How can something more explicit be harder to understand, unless you've only ever seen the abbreviation?
- Someone with no experience of either is going to find the longer option easier to read than the abbreviation, and might even get an inkling of what it actually means when seeing more than a single character.
- It is easy to search for the long version using a search engine or
man bash
. The single character abbreviation, not so much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can something more explicit be harder to understand, unless you've only ever seen the abbreviation?
That answers itself. If you only ever have seen the short variant you don't know it.
Someone with no experience of either is going to find the longer option easier to read than the abbreviation, and might even get an inkling of what it actually means when seeing more than a single character.
The bash options are not self describing and someone having no experience will not understand either.
It is easy to search for the long version using a search engine
Since I am not the only person using the short options you will find a lot of results when searching https://www.google.com/search?q=set+-euo+pipefail
or man bash. The single character abbreviation, not so much.
Thats true. The bash man page is just to long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let it run for 11 minutes and no issues
had to do this though
diff --git a/maintainers/scripts/check-maintainer-github-handles.sh b/maintainers/scripts/check-maintainer-github-handles.sh
index a5555ca9e90..b7007ecc6a5 100755
--- a/maintainers/scripts/check-maintainer-github-handles.sh
+++ b/maintainers/scripts/check-maintainer-github-handles.sh
@@ -11,7 +11,7 @@ function checkCommits {
local ret status tmp user
user="$1"
tmp=$(mktemp)
- curl --silent -w "%{http_code}" \
+ curl --silent -u artturin:${GITHUB_TOKEN} -w "%{http_code}" \
"https://github.com/NixOS/nixpkgs/commits?author=$user" \
> "$tmp"
# the last line of tmp contains the http status
@@ -42,7 +42,7 @@ export -f checkCommits
function checkUser {
local user="$1"
local status=
- status="$(curl --silent --head "https://github.com/${user}" | grep Status)"
+ status="$(curl --silent -u artturin:${GITHUB_TOKEN} --head "https://github.com/${user}" | grep Status)"
# checks whether a user handle can be found on github
if [[ "$status" =~ 404 ]]; then
printf "%s\t\t\t\t%s\n" "$status" "$user"
the script has some pre-existing though such as not properly catching non-existant user handles
Can you do a PR to add that to the script? Having the GITHUB_TOKEN is far more important. Also you don't need to input your username, |
Motivation for this change
ShellCheck compliance and detecting errors earlier, see #133088, #21166.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes@Artturin