Skip to content

Commit 538b70f

Browse files
Merge branch 'stdlib-js:develop' into rfc/hypergeom-skewness
2 parents 59b3fe1 + 1f5d85a commit 538b70f

File tree

3,072 files changed

+103451
-39775
lines changed

Some content is hidden

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

3,072 files changed

+103451
-39775
lines changed

.github/workflows/autoclose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
BODY: |
5959
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not follow our [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md).
6060
61-
Per the guidelines outlined in our [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md), you should download and setup [EditorConfig](http://editorconfig.org/) to ensure that files are automatically configured to use expected indentation and line endings.
61+
Per the guidelines outlined in our [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md), you should download and setup [EditorConfig](http://editorconfig.org/) to ensure that files are automatically configured to use expected indentation and line endings.
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
@@ -94,7 +94,7 @@ jobs:
9494
BODY: |
9595
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not follow our [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md).
9696
97-
Per the guidelines outlined in our [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md), you should have setup your local development environment such that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. We encourage you to refer to that guide **before** continuing to work on this pull request.
97+
Per the guidelines outlined in our [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md), you should have setup your local development environment such that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. We encourage you to refer to that guide **before** continuing to work on this pull request.
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

.github/workflows/check_contributing_guidelines_acceptance.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ on:
4343
types:
4444
- opened
4545
- reopened
46+
- edited
4647

4748
# Global permissions:
4849
permissions:

.github/workflows/good_first_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
1. **You cannot "claim" issues.** People new to open source often want to "claim" or be assigned an issue before beginning work. The typical rationale is that people want to avoid wasted work in the event that someone else ends up working the issue. However, this practice is not effective in open source, as it often leads to "issue squatting", in which an individual asks to be assigned, is granted their request, and then never ends up working on the issue. Accordingly, you are encouraged to communicate your intent to address this issue, ideally by providing a rough outline as to how you plan to address the issue or asking clarifying questions, but, at the end of the day, we will take running code and rough consensus in order to move forward quickly.
6666
2. **We have a very high bar for contributions.** We have very high standards for contributions and expect all contributions—whether new features, tests, or documentation—to be rigorous, thorough, and complete. Once a pull request is merged into stdlib, that contribution immediately becomes the collective responsibility of all maintainers of stdlib. When we merge code into stdlib, we are saying that we, the maintainers, commit to reviewing subsequent changes and making bugfixes to the code. Hence, in order to ensure future maintainability, this naturally leads to a higher standard of contribution.
6767
68-
Before working on this issue and opening a pull request, please read the project's [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md). These guidelines and the associated [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) provide important information, including links to stdlib's [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md), license policy, and steps for setting up your local development environment.
68+
Before working on this issue and opening a pull request, please read the project's [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md). These guidelines and the associated [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) provide important information, including links to stdlib's [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md), license policy, and steps for setting up your local development environment.
6969
7070
To reiterate, we **strongly** encourage you to refer to our contributing guides **before** beginning work on this issue. Failure to follow our guidelines significantly decreases the likelihood that you'll successfully contribute to stdlib and may result in automatic closure of a pull request without review.
7171
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2025 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: label_good_first_prs
21+
22+
# Workflow triggers:
23+
on:
24+
pull_request_target:
25+
types:
26+
- opened
27+
- closed
28+
- synchronize
29+
- reopened
30+
- edited
31+
32+
# Workflow jobs:
33+
jobs:
34+
35+
# Define a job which automatically labels pull requests based on whether they reference good first issues
36+
labeler:
37+
38+
# Define job name:
39+
name: 'Label PRs for issues with label "Good First Issue" as "Good First PR"s'
40+
41+
# Only run this job if the pull request did not have label `automated-pr`:
42+
if: contains(github.event.pull_request.labels.*.name, 'automated-pr') == false
43+
44+
# Define job permissions:
45+
permissions:
46+
contents: read
47+
pull-requests: write
48+
49+
# Define the type of virtual host machine:
50+
runs-on: ubuntu-latest
51+
52+
# Define the sequence of job steps:
53+
steps:
54+
# Checkout the repository:
55+
- name: 'Checkout repository'
56+
# Pin action to full length commit SHA
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
with:
59+
# Specify whether to remove untracked files before checking out the repository:
60+
clean: true
61+
62+
# Limit clone depth to the most recent commit:
63+
fetch-depth: 1
64+
65+
# Specify whether to download Git-LFS files:
66+
lfs: false
67+
timeout-minutes: 10
68+
69+
# Check whether any of the referenced issues is a "Good First Issue":
70+
- name: 'Check whether any of the referenced issues is a "Good First Issue"'
71+
id: 'check-pr'
72+
env:
73+
PR_NUMBER: ${{ github.event.pull_request.number }}
74+
run: |
75+
bool=$(. "$GITHUB_WORKSPACE/.github/workflows/scripts/references_good_first_issue" $PR_NUMBER)
76+
echo "good-first-pr=$bool" >> $GITHUB_OUTPUT
77+
78+
# Add "Good First PR" label if PR references a "Good First Issue"
79+
- name: 'Add "Good First PR" label if PR references a "Good First Issue"'
80+
if: ${{ steps.check-pr.outputs.good-first-pr == 'true' }}
81+
# Pin action to full-length commit SHA
82+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
83+
with:
84+
github-token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
85+
script: |
86+
const { data: pr } = await github.rest.pulls.get({
87+
'owner': context.repo.owner,
88+
'repo': context.repo.repo,
89+
'pull_number': context.payload.pull_request.number
90+
});
91+
const labels = context.payload.pull_request.labels.map( label => label.name );
92+
if ( !labels.includes( 'Good First PR' ) ) {
93+
await github.rest.issues.addLabels({
94+
'owner': context.repo.owner,
95+
'repo': context.repo.repo,
96+
'issue_number': context.payload.pull_request.number,
97+
'labels': [ 'Good First PR' ]
98+
});
99+
}

.github/workflows/labeler_needs_changes.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/lint_pr_title.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
- synchronize
2727
- opened
2828
- reopened
29+
- edited
2930

3031
# Global permissions:
3132
permissions:

.github/workflows/lint_random_files.yml

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ jobs:
199199
- name: 'Lint against EditorConfig'
200200
id: lint-editorconfig
201201
run: |
202+
set -o pipefail
202203
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' ' ')
203204
make lint-editorconfig-files FILES="${files}" 2>&1 | tee lint_editorconfig_errors.txt
204205
@@ -208,6 +209,10 @@ jobs:
208209
env:
209210
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
210211
run: |
212+
strip_ansi() {
213+
sed -r 's/\x1B\[[0-9;]*[mK]//g'
214+
}
215+
211216
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
212217
cat << EOF > "$BODY_FILE"
213218
## EditorConfig Linting Failures
@@ -223,14 +228,15 @@ jobs:
223228
### Error Details
224229
225230
\`\`\`
226-
$(cat lint_editorconfig_errors.txt)
231+
$(cat lint_editorconfig_errors.txt | strip_ansi)
227232
\`\`\`
228233
EOF
229234
230235
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_sub_issue" \
231236
'Fix EditorConfig lint errors' \
232237
"$BODY_FILE" \
233-
"5156"
238+
"5156" \
239+
"Good First Issue"
234240
235241
rm "$BODY_FILE"
236242
@@ -288,8 +294,12 @@ jobs:
288294
289295
# Lint JavaScript files:
290296
- name: 'Lint JavaScript files'
297+
id: lint-javascript
291298
if: ( github.event.inputs.javascript != 'false' ) && ( success() || failure() )
292299
run: |
300+
# If any command in a pipeline fails, the entire pipeline should fail:
301+
set -o pipefail
302+
293303
# Determine root directory:
294304
root=$(git rev-parse --show-toplevel)
295305
@@ -309,45 +319,81 @@ jobs:
309319
FIX=0
310320
fi
311321
322+
# Combined error file:
323+
ERR_FILE="lint_javascript_errors.txt"
324+
> "$ERR_FILE" # Initialize a clean file
325+
312326
# Lint JavaScript source files:
313327
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '\.js$' | grep -v -e '/examples' -e '/test' -e '/benchmark' -e '^dist/' | tr '\n' ' ')
314328
315329
# Build native addons if present:
316330
packages=$(echo "${files}" | tr ' ' '\n' | sed 's/^lib\/node_modules\///g' | sed 's/\/lib\/.*//g' | sort | uniq)
317331
for pkg in ${packages}; do
318-
if [ -f "lib/node_modules/${pkg}/binding.gyp" ]; then
319-
NODE_ADDONS_PATTERN="${pkg}" make install-node-addons
320-
fi
332+
if [ -f "lib/node_modules/${pkg}/binding.gyp" ]; then
333+
NODE_ADDONS_PATTERN="${pkg}" make install-node-addons
334+
fi
321335
done
322336
323337
if [[ -n "${files}" ]]; then
324-
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}"
338+
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" 2>&1 | tee -a "$ERR_FILE"
325339
fi
326340
327341
# Lint JavaScript command-line interfaces...
328342
file=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '\.js$' | grep -E '/bin/cli$' | tr '\n' ' ')
329343
if [[ -n "${file}" ]]; then
330-
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${file}"
344+
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${file}" 2>&1 | tee -a "$ERR_FILE"
331345
fi
332346
333347
# Lint JavaScript example files:
334348
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/examples/.*\.js$' | tr '\n' ' ')
335349
if [[ -n "${files}" ]]; then
336-
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" ESLINT_CONF="${eslint_examples_conf}"
350+
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" ESLINT_CONF="${eslint_examples_conf}" 2>&1 | tee -a "$ERR_FILE"
337351
fi
338352
339353
# Lint JavaScript test files:
340354
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/test/.*\.js$' | tr '\n' ' ')
341355
if [[ -n "${files}" ]]; then
342-
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" ESLINT_CONF="${eslint_tests_conf}"
356+
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" ESLINT_CONF="${eslint_tests_conf}" 2>&1 | tee -a "$ERR_FILE"
343357
fi
344358
345359
# Lint JavaScript benchmark files:
346360
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/benchmark/.*\.js$' | tr '\n' ' ')
347361
if [[ -n "${files}" ]]; then
348-
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" ESLINT_CONF="${eslint_benchmarks_conf}"
362+
make lint-javascript-files FIX="${FIX}" FAST_FAIL=0 FILES="${files}" ESLINT_CONF="${eslint_benchmarks_conf}" 2>&1 | tee -a "$ERR_FILE"
349363
fi
350364
365+
# Create sub-issue for JavaScript lint failures:
366+
- name: 'Create sub-issue for JavaScript lint failures'
367+
if: failure() && contains(steps.lint-javascript.outcome, 'failure')
368+
env:
369+
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
370+
run: |
371+
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
372+
cat << EOF > "$BODY_FILE"
373+
## JavaScript Linting Failures
374+
375+
Linting failures were detected in the automated JavaScript lint workflow run.
376+
377+
### Workflow Details
378+
379+
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
380+
- Type: JavaScript Linting
381+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
382+
383+
### Error Details
384+
\`\`\`
385+
$(cat lint_javascript_errors.txt)
386+
\`\`\`
387+
EOF
388+
389+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_sub_issue" \
390+
'Fix JavaScript lint errors' \
391+
"$BODY_FILE" \
392+
"5377" \
393+
"Good First Issue"
394+
395+
rm "$BODY_FILE"
396+
351397
# Lint Python files:
352398
- name: 'Lint Python files'
353399
if: ( github.event.inputs.python != 'false' ) && ( success() || failure() )

0 commit comments

Comments
 (0)