Skip to content

Commit 1e4ab11

Browse files
Merge branch 'develop' of https://github.com/Neerajpathak07/stdlib into develop
2 parents 00ba7f5 + 3f740e8 commit 1e4ab11

File tree

3,018 files changed

+120350
-21605
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,018 files changed

+120350
-21605
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ indent_style = tab
8686
[*.{f,f.txt}]
8787
indent_style = space
8888
indent_size = 2
89-
insert_final_newline = false
9089

9190
# Set properties for shell files:
9291
[*.{sh,sh.txt}]

.github/workflows/labeler.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
pull_request_target:
2525
types:
2626
- opened
27+
- closed
2728
- synchronize
2829
- reopened
2930
- edited
@@ -64,6 +65,31 @@ jobs:
6465
configuration-path: .github/labeler.yml
6566
repo-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
6667

68+
# Add "First-time Contributor" label if PR is from a first-time contributor:
69+
- name: 'Add "First-time Contributor" label if PR is from a first-time contributor'
70+
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
71+
# Pin action to full-length commit SHA
72+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
73+
with:
74+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
75+
script: |
76+
const { data: pr } = await github.rest.pulls.get({
77+
'owner': context.repo.owner,
78+
'repo': context.repo.repo,
79+
'pull_number': context.payload.pull_request.number
80+
});
81+
if ( pr.author_association === 'FIRST_TIME_CONTRIBUTOR' ) {
82+
const labels = context.payload.pull_request.labels.map( label => label.name );
83+
if ( !labels.includes( 'First-time Contributor' ) ) {
84+
await github.rest.issues.addLabels({
85+
'owner': context.repo.owner,
86+
'repo': context.repo.repo,
87+
'issue_number': context.payload.pull_request.number,
88+
'labels': [ 'First-time Contributor' ]
89+
});
90+
}
91+
}
92+
6793
# Add "Needs Review" label when PR is opened and not a draft:
6894
- name: 'Add "Needs Review" label if PR is opened and not draft'
6995
if: ${{ github.event.action == 'opened' && github.event.pull_request.draft == false }}
@@ -133,3 +159,37 @@ jobs:
133159
console.log( 'Error removing label %s: %s', label, error.message );
134160
}
135161
}
162+
163+
# Remove "First-time Contributor" label from other open PRs of same author if PR is merged:
164+
- name: 'Remove "First-time Contributor" label from other open PRs of same author if PR is merged'
165+
if: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}
166+
# Pin action to full length commit SHA
167+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
168+
with:
169+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
170+
script: |
171+
const prAuthor = context.payload.pull_request.user.login;
172+
const { owner, repo } = context.repo;
173+
174+
// Search for all open PRs from the PR author:
175+
const query = `repo:${owner}/${repo} type:pr state:open author:${prAuthor}`;
176+
const response = await github.rest.search.issuesAndPullRequests({
177+
'q': query,
178+
'per_page': 100
179+
});
180+
181+
const pullRequests = response.data.items;
182+
for ( const pull of pullRequests ) {
183+
if ( pull.user.login === prAuthor ) {
184+
try {
185+
await github.rest.issues.removeLabel({
186+
'owner': context.repo.owner,
187+
'repo': context.repo.repo,
188+
'issue_number': pull.number,
189+
'name': 'First-time Contributor'
190+
});
191+
} catch ( error ) {
192+
console.log( 'Error removing "First-time Contributor" label from PR #%d: %s', pull.number, error.message );
193+
}
194+
}
195+
}

.github/workflows/lint_changed_files.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,21 @@ jobs:
7272
node-version: '20' # 'lts/*'
7373
timeout-minutes: 5
7474

75+
# Cache dependencies:
76+
- name: 'Cache dependencies'
77+
# Pin action to full length commit SHA
78+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
79+
id: cache
80+
with:
81+
path: |
82+
${{ github.workspace }}/node_modules
83+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
84+
restore-keys: |
85+
${{ runner.os }}-node-
86+
7587
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
7688
- name: 'Install dependencies'
89+
if: steps.cache.outputs.cache-hit != 'true'
7790
run: |
7891
make install-node-modules || make install-node-modules || make install-node-modules
7992
timeout-minutes: 15
@@ -120,7 +133,7 @@ jobs:
120133
- name: 'Lint against EditorConfig'
121134
if: success() || failure()
122135
run: |
123-
make lint-editorconfig-files FILES="${{ steps.changed-files.outputs.files }}"
136+
make lint-editorconfig-files EDITORCONFIG_FORMAT=github-actions FILES="${{ steps.changed-files.outputs.files }}"
124137
125138
# Lint Markdown files:
126139
- name: 'Lint Markdown files'

.github/workflows/namespace_declarations.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ jobs:
112112
113113
- updates namespace TypeScript declarations
114114
115+
## Reviewer Checklist
116+
117+
- [ ] **Check the scope of the changes** (following [Conventional Commits](https://www.conventionalcommits.org)):
118+
- Are these **new APIs**? Then this is a `feat`.
119+
- Are these **changes to existing APIs** that could break compatibility? Then this is a `feat!` (i.e., a breaking change).
120+
- Are these **only documentation** changes to existing APIs? Then this is `docs`.
121+
- [ ] Update the PR title to align with the change type (`feat`, `feat!`, or `docs`).
122+
- [ ] Approve the PR once you are confident about the classification and changes made.
123+
115124
commit-message: 'feat: update namespace TypeScript declarations'
116125
committer: 'stdlib-bot <[email protected]>'
117126
signoff: true

.github/workflows/run_affected_benchmarks.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,21 @@ jobs:
7878
node-version: '20' # 'lts/*'
7979
timeout-minutes: 5
8080

81+
# Cache dependencies:
82+
- name: 'Cache dependencies'
83+
# Pin action to full length commit SHA
84+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
85+
id: cache
86+
with:
87+
path: |
88+
${{ github.workspace }}/node_modules
89+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
90+
restore-keys: |
91+
${{ runner.os }}-node-
92+
8193
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
8294
- name: 'Install dependencies'
95+
if: steps.cache.outputs.cache-hit != 'true'
8396
run: |
8497
make install-node-modules || make install-node-modules || make install-node-modules
8598
timeout-minutes: 15

.github/workflows/run_affected_examples.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,21 @@ jobs:
7979
node-version: '20' # 'lts/*'
8080
timeout-minutes: 5
8181

82+
# Cache dependencies:
83+
- name: 'Cache dependencies'
84+
# Pin action to full length commit SHA
85+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
86+
id: cache
87+
with:
88+
path: |
89+
${{ github.workspace }}/node_modules
90+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
91+
restore-keys: |
92+
${{ runner.os }}-node-
93+
8294
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
8395
- name: 'Install dependencies'
96+
if: steps.cache.outputs.cache-hit != 'true'
8497
run: |
8598
make install-node-modules || make install-node-modules || make install-node-modules
8699
timeout-minutes: 15

.github/workflows/run_affected_tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,21 @@ jobs:
114114
node-version: '20' # 'lts/*'
115115
timeout-minutes: 5
116116

117+
# Cache dependencies:
118+
- name: 'Cache dependencies'
119+
# Pin action to full length commit SHA
120+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
121+
id: cache
122+
with:
123+
path: |
124+
${{ github.workspace }}/node_modules
125+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
126+
restore-keys: |
127+
${{ runner.os }}-node-
128+
117129
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
118130
- name: 'Install dependencies'
131+
if: steps.cache.outputs.cache-hit != 'true'
119132
run: |
120133
make install-node-modules || make install-node-modules || make install-node-modules
121134
timeout-minutes: 15

.github/workflows/run_tests_coverage.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,21 @@ jobs:
120120
node-version: 20 # 'lts/*'
121121
timeout-minutes: 5
122122

123+
# Cache dependencies:
124+
- name: 'Cache dependencies'
125+
# Pin action to full length commit SHA
126+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
127+
id: cache
128+
with:
129+
path: |
130+
${{ github.workspace }}/node_modules
131+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
132+
restore-keys: |
133+
${{ runner.os }}-node-
134+
123135
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
124136
- name: 'Install dependencies'
137+
if: steps.cache.outputs.cache-hit != 'true'
125138
run: |
126139
make install-node-modules || make install-node-modules || make install-node-modules
127140
timeout-minutes: 15

.github/workflows/slash_commands.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ jobs:
6161
- name: 'Add initial reaction'
6262
run: |
6363
COMMENT="${{ github.event.comment.body }}"
64-
if [[ $COMMENT == "/stdlib help" || \
65-
$COMMENT == "/stdlib check-files" || \
66-
$COMMENT == "/stdlib update-copyright-years" || \
67-
$COMMENT == "/stdlib lint-autofix" || \
68-
$COMMENT == "/stdlib merge" || \
69-
$COMMENT == "/stdlib rebase"
70-
]]; then
64+
if [[ $COMMENT =~ ^/stdlib\ (help|check-files|update-copyright-years|lint-autofix|merge|rebase) ]]; then
7165
curl -X POST \
7266
-H "Accept: application/vnd.github.v3+json" \
7367
-H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}" \

.github/workflows/update_contributors.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ jobs:
105105
106106
- updates the list of contributors
107107
108+
## Reviewer Checklist
109+
110+
- [ ] For any **new contributors**, check if their full names are listed on their GitHub profile or in social links.
111+
- [ ] If so, on the PR branch **update** the `.mailmap` file accordingly to ensure proper attribution.
112+
- [ ] If updating `.mailmap`, **regenerate** the contributors file by running `make update-contributors` on the PR branch afterward.
113+
- [ ] Approve the PR after verifying the changes.
114+
108115
commit-message: 'docs: update list of contributors'
109116
committer: 'stdlib-bot <[email protected]>'
110117
signoff: true

0 commit comments

Comments
 (0)