Skip to content

Commit

Permalink
Merge branch 'master' into ispath
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner authored Apr 22, 2024
2 parents 3dcccf9 + b5bfd83 commit e017c11
Show file tree
Hide file tree
Showing 976 changed files with 56,439 additions and 25,131 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/Typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Typos

permissions: {}

on: [pull_request]

jobs:
typos-check:
name: Check for new typos
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the JuliaLang/julia repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check spelling with typos
#uses: crate-ci/typos@master
env:
GH_TOKEN: "${{ github.token }}"
run: |
git fetch --depth=1 origin ${{ github.base_ref }}
OLD_FILES=$(git diff-index --name-only --diff-filter=ad FETCH_HEAD)
NEW_FILES=$(git diff-index --name-only --diff-filter=d FETCH_HEAD)
# This is necessary because the typos command interprets the
# empty string as "check all files" rather than "check no files".
if [ -z "$NEW_FILES" ]; then
echo "All edited files were deleted. Skipping typos check."
exit 0
fi
mkdir -p "${{ runner.temp }}/typos"
RELEASE_ASSET_URL="$(
gh api /repos/crate-ci/typos/releases/latest \
--jq '."assets"[] | select(."name" | test("^typos-.+-x86_64-unknown-linux-musl\\.tar\\.gz$")) | ."browser_download_url"'
)"
wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \
--quiet --output-document=- "${RELEASE_ASSET_URL}" \
| tar -xz -C "${{ runner.temp }}/typos" ./typos
"${{ runner.temp }}/typos/typos" --version
echo -n $NEW_FILES | xargs "${{ runner.temp }}/typos/typos" --format json >> ${{ runner.temp }}/new_typos.jsonl || true
git checkout FETCH_HEAD -- $OLD_FILES
if [ -z "$OLD_FILES" ]; then
touch "${{ runner.temp }}/old_typos.jsonl" # No old files, so no old typos.
else
echo -n $OLD_FILES | xargs "${{ runner.temp }}/typos/typos" --format json >> ${{ runner.temp }}/old_typos.jsonl || true
fi
python -c '
import sys, json
old = set()
with open(sys.argv[1]) as old_file:
for line in old_file:
j = json.loads(line)
if j["type"] == "typo":
old.add(j["typo"])
clean = True
with open(sys.argv[2]) as new_file:
for line in new_file:
new = json.loads(line)
if new["type"] == "typo" and new["typo"] not in old:
if len(new["typo"]) > 6: # Short typos might be false positives. Long are probably real.
clean = False
print("::warning file={},line={},col={}::perhaps \"{}\" should be \"{}\".".format(
new["path"], new["line_num"], new["byte_offset"],
new["typo"], " or ".join(new["corrections"])))
sys.exit(1 if not clean else 0)' "${{ runner.temp }}/old_typos.jsonl" "${{ runner.temp }}/new_typos.jsonl"
33 changes: 33 additions & 0 deletions .github/workflows/cffconvert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: cffconvert

on:
push:
branches:
- 'master'
- 'release-*'
paths:
- CITATION.cff
pull_request:
branches:
- 'master'
- 'release-*'
paths:
- CITATION.cff

permissions:
contents: read

jobs:
validate:
name: "validate"
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/[email protected]
with:
args: "--validate"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
# Buildkite: Ignore the entire .buildkite directory
/.buildkite

# Builtkite: json test data
/test/results.json

# Buildkite: Ignore the unencrypted repo_key
repo_key

Expand Down
1 change: 1 addition & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Official format description at https://citation-file-format.github.io
cff-version: 1.2.0
message: "Cite this paper whenever you use Julia"
authors:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ please remove the `backport-X.Y` tag from the originating pull request for the c
### Git Recommendations For Pull Requests

- 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.
- 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.
- 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.
- 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.
- Descriptive commit messages are good.
- Using `git add -p` or `git add -i` can be useful to avoid accidentally committing unrelated changes.
Expand Down
Loading

0 comments on commit e017c11

Please sign in to comment.