Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
Improve scripts and tool configurations#1693
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
8c4df3c
f3be76f
7dd8add
21875b5
0920371
e973f52
be53823
e604b46
19dfbd8
7110bf8
c7cdaf4
f6dbba2
5060c9d
d5479b2
52f9a68
b88d07e
d36818c
4ba5ad1
5d8ddd9
a872d9c
9b9de11
5d15063
6de86a8
f094909
fc96980
b98f15e
7cca7d2
e4e009d
e16e4c0
62c024e
9e245d0
c2472e9
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,4 +3,4 @@ updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
repos: | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev:23.9.1 | ||
hooks: | ||
- id:black | ||
alias: black-check | ||
name: black (check) | ||
args: [--check, --diff] | ||
exclude: ^git/ext/ | ||
stages: [manual] | ||
- id: black | ||
alias: black-format | ||
name: black (format) | ||
exclude: ^git/ext/ | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bugbear==23.9.16 | ||
- flake8-comprehensions==3.14.0 | ||
- flake8-typing-imports==1.14.0 | ||
exclude: ^doc|^git/ext/ | ||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: v0.9.0.5 | ||
hooks: | ||
- id: shellcheck | ||
args: [--color] | ||
exclude: ^git/ext/ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-merge-conflict |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,29 +10,39 @@ trap 'echo "$0: Check failed. Stopping." >&2' ERR | ||
readonly version_path='VERSION' | ||
readonly changes_path='doc/source/changes.rst' | ||
function check_status() { | ||
EliahKagan marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
git status -s "$@" | ||
test -z "$(git status -s "$@")" | ||
} | ||
function get_latest_tag() { | ||
local config_opts | ||
printf -v config_opts ' -c versionsort.suffix=-%s' alpha beta pre rc RC | ||
EliahKagan marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
# shellcheck disable=SC2086 # Deliberately word-splitting the arguments. | ||
git $config_opts tag -l '[0-9]*' --sort=-v:refname | head -n1 | ||
} | ||
echo 'Checking current directory.' | ||
test "$(cd -- "$(dirname -- "$0")" && pwd)" = "$(pwd)" # Ugly, but portable. | ||
echo "Checking that $version_path and $changes_path exist and have no uncommitted changes." | ||
test -f "$version_path" | ||
test -f "$changes_path" | ||
check_status -- "$version_path" "$changes_path" | ||
# This section can be commented out, if absolutely necessary. | ||
echo 'Checking that ALL changes are committed.' | ||
check_status --ignore-submodules | ||
version_version="$(<"$version_path")" | ||
changes_version="$(awk '/^[0-9]/ {print $0; exit}' "$changes_path")" | ||
latest_tag="$(get_latest_tag)" | ||
head_sha="$(git rev-parse HEAD)" | ||
latest_tag_sha="$(git rev-parse "${latest_tag}^{commit}")" | ||
# Display a table of all the current version, tag, and HEAD commit information. | ||
echo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This conveys spacing much better thanks to the separate MemberAuthor
| ||
echo 'The VERSION must be the same in all locations, and so must the HEAD and tag SHA' | ||
printf '%-14s = %s\n' 'VERSION file' "$version_version" \ | ||
'changes.rst' "$changes_version" \ | ||
'Latest tag' "$latest_tag" \ | ||
Uh oh!
There was an error while loading.Please reload this page.