Skip to content

Commit c9e7b66

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into dtrti2
2 parents 3ede852 + a393090 commit c9e7b66

File tree

13,114 files changed

+841346
-76185
lines changed

Some content is hidden

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

13,114 files changed

+841346
-76185
lines changed

.clang-format

Lines changed: 1844 additions & 0 deletions
Large diffs are not rendered by default.

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ indent_style = tab
121121
[*.{md,md.txt}]
122122
indent_style = space
123123
indent_size = 4
124-
trim_trailing_whitespace = false
124+
trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim.
125125
126126
# Set properties for `usage.txt` files:
127127
[usage.txt]

.github/labeler.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,15 @@ LAPACK:
2727
Math:
2828
- changed-files:
2929
- any-glob-to-all-files: '**/math/**/*'
30+
31+
REPL:
32+
- changed-files:
33+
- any-glob-to-all-files: '**/repl/**/*'
34+
35+
Statistics:
36+
- changed-files:
37+
- any-glob-to-all-files: '**/stats/**/*'
38+
39+
Tools:
40+
- changed-files:
41+
- any-glob-to-all-files: '**/_tools/**/*'

.github/workflows/autoclose.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
6363
If you would prefer to avoid manual setup, you could also consider using a pre-configured [development container](https://github.com/stdlib-js/stdlib/tree/develop/.devcontainer) for use locally or in GitHub Codespaces.
6464
65-
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
65+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.
6666
6767
# Define a job which closes a pull request if a contributor failed to follow contributing guidelines:
6868
contributor_guidelines:
@@ -98,7 +98,7 @@ jobs:
9898
9999
If you would prefer to avoid manual setup, you could also consider using a pre-configured [development container](https://github.com/stdlib-js/stdlib/tree/develop/.devcontainer) for use locally or in GitHub Codespaces.
100100
101-
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
101+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.
102102
103103
# Define a job which closes a pull request if a contributor failed to follow project conventions:
104104
project_conventions:
@@ -138,7 +138,7 @@ jobs:
138138
139139
In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase **before** continuing to work on this pull request.
140140
141-
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
141+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.
142142
143143
# Define a job which closes a pull request if a pull request is considered spam:
144144
spam:
@@ -170,7 +170,7 @@ jobs:
170170
BODY: |
171171
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not meet the standards of this project.
172172
173-
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
173+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.
174174
175175
# Lock pull request conversation:
176176
- name: 'Lock conversation'
@@ -179,3 +179,35 @@ jobs:
179179
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
180180
GH_REPO: ${{ github.repository }}
181181
NUMBER: ${{ github.event.pull_request.number }}
182+
183+
# Define a job which closes a pull request if a pull request is considered stale:
184+
stale:
185+
186+
# Define job name:
187+
name: 'Check for stale label'
188+
189+
# Only run this job if the pull request has a specific label:
190+
if: "${{ github.event.label.name == 'autoclose: Stale' }}"
191+
192+
# Define job permissions:
193+
permissions:
194+
contents: read
195+
issues: write
196+
pull-requests: write
197+
198+
# Define the type of virtual host machine:
199+
runs-on: ubuntu-latest
200+
201+
# Define the sequence of job steps:
202+
steps:
203+
# Close the pull request:
204+
- name: 'Close pull request'
205+
run: gh pr close "$NUMBER" --comment "$BODY"
206+
env:
207+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
208+
GH_REPO: ${{ github.repository }}
209+
NUMBER: ${{ github.event.pull_request.number }}
210+
BODY: |
211+
This pull request has been automatically closed because it has been inactive for an extended period after changes were requested. If you still wish to pursue this contribution, feel free to reopen the pull request or submit a new one.
212+
213+
We appreciate your interest in contributing to stdlib!

.github/workflows/check_licenses.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
# Install Node.js:
8282
- name: 'Install Node.js'
8383
# Pin action to full length commit SHA
84-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
84+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
8585
with:
8686
node-version: '20' # 'lts/*'
8787
timeout-minutes: 5
@@ -128,7 +128,7 @@ jobs:
128128
# Upload the log file:
129129
- name: 'Upload log file'
130130
# Pin action to full length commit SHA
131-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
131+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
132132
if: always()
133133
with:
134134
# Define a name for the uploaded artifact:
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: cleanup_coverage
21+
22+
# Workflow triggers:
23+
on:
24+
25+
# Trigger the workflow when a pull request is closed (e.g., merged or closed without merging):
26+
pull_request_target:
27+
types:
28+
- closed
29+
30+
# Workflow jobs:
31+
jobs:
32+
33+
# Define a job to perform coverage cleanup...
34+
cleanup:
35+
36+
# Define a display name:
37+
name: 'Cleanup coverage'
38+
39+
# Define the type of virtual host machine:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
# Delete the 'pr-<number>' branch from the 'stdlib-js/www-test-code-coverage' repository:
44+
- name: 'Delete coverage branch for PR'
45+
env:
46+
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
47+
PR_NUMBER: ${{ github.event.pull_request.number }}
48+
run: |
49+
curl -X DELETE -H "Authorization: token $REPO_GITHUB_TOKEN" \
50+
"https://api.github.com/repos/stdlib-js/www-test-code-coverage/git/refs/heads/pr-${PR_NUMBER}" \
51+
|| echo "Branch pr-${PR_NUMBER} does not exist or could not be deleted."
52+
53+
# Find and update the '## Coverage Report' comment in the PR
54+
- name: 'Update coverage comment in PR'
55+
# Pin action to full length commit SHA
56+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
57+
with:
58+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
59+
script: |
60+
const prNumber = context.payload.pull_request.number;
61+
const { data: comments } = await github.rest.issues.listComments({
62+
'owner': context.repo.owner,
63+
'repo': context.repo.repo,
64+
'issue_number': prNumber
65+
});
66+
const coverageComment = comments.find( comment => comment.body && comment.body.includes( '## Coverage Report' ) );
67+
if ( coverageComment ) {
68+
// Replace URLs with plain text in the coverage report comment body:
69+
const updatedBody = coverageComment.body.replace( /<a href="[^"]+">([^<]+)<\/a>/g, '$1' );
70+
await github.rest.issues.updateComment({
71+
'owner': context.repo.owner,
72+
'repo': context.repo.repo,
73+
'comment_id': coverageComment.id,
74+
'body': updatedBody
75+
});
76+
} else {
77+
console.log( 'No Coverage Report comment found.' );
78+
}

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
# Install Node.js:
122122
- name: 'Install Node.js'
123123
# Pin action to full length commit SHA
124-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
124+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
125125
with:
126126
node-version: '20' # 'lts/*'
127127
timeout-minutes: 5
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: generate_pr_commit_message
21+
22+
# Workflow triggers:
23+
on:
24+
pull_request_target:
25+
types:
26+
- labeled
27+
28+
# Global permissions:
29+
permissions:
30+
# Allow read-only access to the repository contents:
31+
contents: read
32+
33+
# Allow write access to issues, assignees, labels, and milestones:
34+
issues: write
35+
36+
# Allow write access to pull requests:
37+
pull-requests: write
38+
39+
# Workflow jobs:
40+
jobs:
41+
42+
# Job to generate commit message draft:
43+
generate-commit-message:
44+
45+
# Define a display name:
46+
name: 'Generate PR Commit Message Draft'
47+
48+
# Define the type of virtual host machine:
49+
runs-on: ubuntu-latest
50+
51+
# Ensure the job only runs when the specified label is added:
52+
if: github.event.label.name == 'Ready to Merge'
53+
54+
# Define environment variables:
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
PR_NUMBER: ${{ github.event.pull_request.number }}
58+
59+
# Define the sequence of job steps...
60+
steps:
61+
# Checkout repository:
62+
- name: 'Checkout repository'
63+
uses: actions/checkout@v4
64+
with:
65+
# Fetch all commits to ensure we have the full commit history:
66+
fetch-depth: 0
67+
68+
# Generate commit message:
69+
- name: 'Generate commit message'
70+
id: commit_message
71+
run: |
72+
COMMIT_MESSAGE=$($GITHUB_WORKSPACE/.github/workflows/scripts/generate_pr_commit_message $PR_NUMBER)
73+
EXIT_CODE=$?
74+
75+
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
76+
echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
77+
echo "EOF" >> $GITHUB_OUTPUT
78+
79+
if [ $EXIT_CODE -eq 200 ]; then
80+
echo "has_tracking_issue=true" >> $GITHUB_OUTPUT
81+
else
82+
echo "has_tracking_issue=false" >> $GITHUB_OUTPUT
83+
fi
84+
85+
# Ensure the script itself doesn't fail the workflow:
86+
exit 0
87+
88+
# Post commit message as PR comment:
89+
- name: 'Post commit message as PR comment'
90+
uses: peter-evans/create-or-update-comment@v4
91+
with:
92+
token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
93+
issue-number: ${{ github.event.pull_request.number }}
94+
body: |
95+
### PR Commit Message
96+
97+
```text
98+
${{ steps.commit_message.outputs.commit_message }}
99+
```
100+
101+
*Please review the above commit message and make any necessary adjustments.*
102+
103+
${{ steps.commit_message.outputs.has_tracking_issue == 'true' && '⚠️ **Action Required**: This PR references tracking issues. Please update the PR description to replace any "Closes", "Fixes", or "Resolves" keywords with "Ref" when referencing these issues.' || '' }}

0 commit comments

Comments
 (0)