Skip to content

Commit 9aee915

Browse files
authored
Merge branch 'master' into sb/mpfr-scope
2 parents 2adfa2d + b8a0a39 commit 9aee915

File tree

918 files changed

+51971
-31359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

918 files changed

+51971
-31359
lines changed

.github/workflows/Typos.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Typos
2+
3+
permissions: {}
4+
5+
on: [pull_request]
6+
7+
jobs:
8+
typos-check:
9+
name: Check for new typos
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
steps:
13+
- name: Checkout the JuliaLang/julia repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Check spelling with typos
18+
#uses: crate-ci/typos@master
19+
env:
20+
GH_TOKEN: "${{ github.token }}"
21+
run: |
22+
git fetch --depth=1 origin ${{ github.base_ref }}
23+
OLD_FILES=$(git diff-index --name-only --diff-filter=ad FETCH_HEAD)
24+
NEW_FILES=$(git diff-index --name-only --diff-filter=d FETCH_HEAD)
25+
26+
# This is necessary because the typos command interprets the
27+
# empty string as "check all files" rather than "check no files".
28+
if [ -z "$NEW_FILES" ]; then
29+
echo "All edited files were deleted. Skipping typos check."
30+
exit 0
31+
fi
32+
33+
mkdir -p "${{ runner.temp }}/typos"
34+
RELEASE_ASSET_URL="$(
35+
gh api /repos/crate-ci/typos/releases/latest \
36+
--jq '."assets"[] | select(."name" | test("^typos-.+-x86_64-unknown-linux-musl\\.tar\\.gz$")) | ."browser_download_url"'
37+
)"
38+
wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \
39+
--quiet --output-document=- "${RELEASE_ASSET_URL}" \
40+
| tar -xz -C "${{ runner.temp }}/typos" ./typos
41+
"${{ runner.temp }}/typos/typos" --version
42+
43+
echo -n $NEW_FILES | xargs "${{ runner.temp }}/typos/typos" --format json >> ${{ runner.temp }}/new_typos.jsonl || true
44+
git checkout FETCH_HEAD -- $OLD_FILES
45+
if [ -z "$OLD_FILES" ]; then
46+
touch "${{ runner.temp }}/old_typos.jsonl" # No old files, so no old typos.
47+
else
48+
echo -n $OLD_FILES | xargs "${{ runner.temp }}/typos/typos" --format json >> ${{ runner.temp }}/old_typos.jsonl || true
49+
fi
50+
51+
52+
python -c '
53+
import sys, json
54+
old = set()
55+
with open(sys.argv[1]) as old_file:
56+
for line in old_file:
57+
j = json.loads(line)
58+
if j["type"] == "typo":
59+
old.add(j["typo"])
60+
clean = True
61+
with open(sys.argv[2]) as new_file:
62+
for line in new_file:
63+
new = json.loads(line)
64+
if new["type"] == "typo" and new["typo"] not in old:
65+
if len(new["typo"]) > 6: # Short typos might be false positives. Long are probably real.
66+
clean = False
67+
print("::warning file={},line={},col={}::perhaps \"{}\" should be \"{}\".".format(
68+
new["path"], new["line_num"], new["byte_offset"],
69+
new["typo"], " or ".join(new["corrections"])))
70+
sys.exit(1 if not clean else 0)' "${{ runner.temp }}/old_typos.jsonl" "${{ runner.temp }}/new_typos.jsonl"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
# Buildkite: Ignore the entire .buildkite directory
4040
/.buildkite
4141

42+
# Builtkite: json test data
43+
/test/results.json
44+
4245
# Buildkite: Ignore the unencrypted repo_key
4346
repo_key
4447

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ please remove the `backport-X.Y` tag from the originating pull request for the c
347347
### Git Recommendations For Pull Requests
348348

349349
- Avoid working from the `master` branch of your fork, creating a new branch will make it easier if Julia's `master` changes and you need to update your pull request.
350-
- Try to [squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) together small commits that make repeated changes to the same section of code so your pull request is easier to review. A reasonable number of separate well-factored commits is fine, especially for larger changes.
350+
- Try to [squash](https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) together small commits that make repeated changes to the same section of code so your pull request is easier to review. A reasonable number of separate well-factored commits is fine, especially for larger changes.
351351
- If any conflicts arise due to changes in Julia's `master`, prefer updating your pull request branch with `git rebase` versus `git merge` or `git pull`, since the latter will introduce merge commits that clutter the git history with noise that makes your changes more difficult to review.
352352
- Descriptive commit messages are good.
353353
- Using `git add -p` or `git add -i` can be useful to avoid accidentally committing unrelated changes.

0 commit comments

Comments
 (0)