Skip to content

Commit dc85b7f

Browse files
Merge branch 'Add-C-implementations-to-base-special-math-functions' of https://github.com/vivekmaurya001/stdlib into Add-C-implementations-to-base-special-math-functions
2 parents b50cd39 + 4ddb42d commit dc85b7f

File tree

1,609 files changed

+105836
-2160
lines changed

Some content is hidden

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

1,609 files changed

+105836
-2160
lines changed

.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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ 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/**/*'

.github/workflows/cleanup_coverage.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ jobs:
5959
script: |
6060
const prNumber = context.payload.pull_request.number;
6161
const { data: comments } = await github.rest.issues.listComments({
62-
owner: context.repo.owner,
63-
repo: context.repo.repo,
64-
issue_number: prNumber,
62+
'owner': context.repo.owner,
63+
'repo': context.repo.repo,
64+
'issue_number': prNumber
6565
});
6666
const coverageComment = comments.find( comment => comment.body && comment.body.includes( '## Coverage Report' ) );
6767
if ( coverageComment ) {
6868
// Replace URLs with plain text in the coverage report comment body:
6969
const updatedBody = coverageComment.body.replace( /<a href="[^"]+">([^<]+)<\/a>/g, '$1' );
7070
await github.rest.issues.updateComment({
71-
owner: context.repo.owner,
72-
repo: context.repo.repo,
73-
comment_id: coverageComment.id,
74-
body: updatedBody,
71+
'owner': context.repo.owner,
72+
'repo': context.repo.repo,
73+
'comment_id': coverageComment.id,
74+
'body': updatedBody
7575
});
7676
} else {
7777
console.log( 'No Coverage Report comment found.' );

.github/workflows/labeler.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
- review_request_removed
3232
- ready_for_review
3333
- converted_to_draft
34+
- labeled
3435

3536
# Workflow jobs:
3637
jobs:
@@ -75,12 +76,12 @@ jobs:
7576
'owner': context.repo.owner,
7677
'repo': context.repo.repo,
7778
'issue_number': context.payload.pull_request.number,
78-
'labels': ['Needs Review'],
79+
'labels': [ 'Needs Review' ]
7980
})
8081
81-
# Add "Needs Review" label when PR is marked ready for review:
82-
- name: 'Add "Needs Review" label if PR is ready for review'
83-
if: ${{ github.event.action == 'ready_for_review' }}
82+
# Add "Needs Review" label when PR is marked ready for review or review is requested:
83+
- name: 'Add "Needs Review" label if PR is ready for review or review is requested'
84+
if: ${{ github.event.action == 'ready_for_review' || github.event.action == 'review_requested' }}
8485
# Pin action to full length commit SHA
8586
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
8687
with:
@@ -90,7 +91,7 @@ jobs:
9091
'owner': context.repo.owner,
9192
'repo': context.repo.repo,
9293
'issue_number': context.payload.pull_request.number,
93-
'labels': ['Needs Review'],
94+
'labels': [ 'Needs Review' ]
9495
})
9596
9697
# Remove "Needs Review" label when PR is converted to draft or closed:
@@ -106,8 +107,29 @@ jobs:
106107
'owner': context.repo.owner,
107108
'repo': context.repo.repo,
108109
'issue_number': context.payload.pull_request.number,
109-
'name': 'Needs Review',
110+
'name': 'Needs Review'
110111
})
111112
} catch ( error ) {
112113
console.log( 'Error removing label: %s', error.message );
113114
}
115+
116+
# Remove "Needs Review" and "Needs Changes" labels when "Ready To Merge" is assigned:
117+
- name: 'Remove "Needs Review" and "Needs Changes" labels when "Ready To Merge" is assigned'
118+
if: ${{ github.event.action == 'labeled' && github.event.label.name == 'Ready To Merge' }}
119+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
120+
with:
121+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
122+
script: |
123+
const labelsToRemove = [ 'Needs Review', 'Needs Changes' ];
124+
for ( const label of labelsToRemove ) {
125+
try {
126+
await github.rest.issues.removeLabel({
127+
'owner': context.repo.owner,
128+
'repo': context.repo.repo,
129+
'issue_number': context.payload.pull_request.number,
130+
'name': label
131+
})
132+
} catch ( error ) {
133+
console.log( 'Error removing label %s: %s', label, error.message );
134+
}
135+
}

.github/workflows/lint_changed_files.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ permissions:
3939
jobs:
4040

4141
# Define a job for linting committed code...
42-
process:
42+
lint:
4343

4444
# Define a display name:
4545
name: 'Lint Changed Files'
@@ -104,7 +104,7 @@ jobs:
104104
files=$(echo "$files" | tr '\n' ' ' | sed 's/ $//')
105105
echo "files=${files}" >> $GITHUB_OUTPUT
106106
107-
# Lint file names
107+
# Lint file names:
108108
- name: 'Lint file names'
109109
run: |
110110
# Determine root directory:
@@ -116,6 +116,12 @@ jobs:
116116
# Lint filenames:
117117
echo "${{ steps.changed-files.outputs.files }}" || "${lint_filenames}"
118118
119+
# Lint files against EditorConfig:
120+
- name: 'Lint against EditorConfig'
121+
if: success() || failure()
122+
run: |
123+
make lint-editorconfig-files FILES="${{ steps.changed-files.outputs.files }}"
124+
119125
# Lint Markdown files:
120126
- name: 'Lint Markdown files'
121127
if: success() || failure()
@@ -142,19 +148,7 @@ jobs:
142148
- name: 'Lint package.json files'
143149
if: success() || failure()
144150
run: |
145-
# Determine root directory:
146-
root=$(git rev-parse --show-toplevel)
147-
148-
# Define the path to a utility for linting package.json files:
149-
lint_package_json="${root}/lib/node_modules/@stdlib/_tools/lint/pkg-json/bin/cli"
150-
151-
files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep 'package\.json$' | grep -v 'datapackage\.json$' | tr '\n' ' ' | sed 's/ $//')
152-
if [ -n "${files}" ]; then
153-
echo "Linting package.json files that have changed..."
154-
printf "${files}" | "${lint_package_json}" --split=" "
155-
else
156-
echo "No package.json files to lint."
157-
fi
151+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/lint_package_json_files" "${{ steps.changed-files.outputs.files }}"
158152
159153
# Lint REPL help files...
160154
- name: 'Lint REPL help files'

.github/workflows/lint_random_files.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
184184
echo "files=$files" >> $GITHUB_OUTPUT
185185
186-
# Lint file names
186+
# Lint file names:
187187
- name: 'Lint file names'
188188
run: |
189189
# Determine root directory:
@@ -195,6 +195,12 @@ jobs:
195195
# Lint filenames:
196196
echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | "${lint_filenames}"
197197
198+
# Lint files against EditorConfig:
199+
- name: 'Lint against EditorConfig'
200+
run: |
201+
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' ' ')
202+
make lint-editorconfig-files FILES="${files}"
203+
198204
# Lint Markdown files:
199205
- name: 'Lint Markdown files'
200206
if: ( github.event.inputs.markdown != 'false' ) && ( success() || failure() )
@@ -393,15 +399,30 @@ jobs:
393399
env:
394400
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
395401
run: |
396-
# Create a temporary file for storing lint error messages:
397-
ERROR_LOG=$(mktemp)
398-
grep -B 1 -A 2 "style:\|warning:\|error:" <<< "${{ steps.lint-c.outputs.stderr }}" > $ERROR_LOG
399-
400-
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_lint_sub_issue" \
401-
"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
402-
"C" \
403-
"3235" \ # Number of C lint error tracking issue
404-
"$ERROR_LOG"
402+
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
403+
404+
cat << EOF > "$BODY_FILE"
405+
## C Linting Failures
406+
407+
Linting failures were detected in the automated lint workflow run.
408+
409+
### Workflow Details
410+
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
411+
- Type: C Linting
412+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
413+
414+
### Error Details
415+
\`\`\`
416+
$(grep -B 1 -A 2 "style:\|warning:\|error:" <<< "${{ steps.lint-c.outputs.stderr }}")
417+
\`\`\`
418+
EOF
419+
420+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_sub_issue" \
421+
'Fix C lint errors' \
422+
"$BODY_FILE" \
423+
"3235" # Number of C lint error tracking issue
424+
425+
rm "$BODY_FILE"
405426
406427
# Lint TypeScript declarations files:
407428
- name: 'Lint TypeScript declarations files'

.github/workflows/run_tests_coverage.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,25 @@ jobs:
226226
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
227227
script: |
228228
const { data: comments } = await github.rest.issues.listComments({
229-
issue_number: context.issue.number,
230-
owner: context.repo.owner,
231-
repo: context.repo.repo,
229+
'issue_number': context.issue.number,
230+
'owner': context.repo.owner,
231+
'repo': context.repo.repo,
232232
});
233233
234234
const botComment = comments.find( comment => comment.user.login === 'stdlib-bot' && comment.body.includes( '## Coverage Report' ) );
235235
if ( botComment ) {
236236
await github.rest.issues.updateComment({
237-
owner: context.repo.owner,
238-
repo: context.repo.repo,
239-
comment_id: botComment.id,
240-
body: `${{ steps.create-report.outputs.report }}`,
237+
'owner': context.repo.owner,
238+
'repo': context.repo.repo,
239+
'comment_id': botComment.id,
240+
'body': `${{ steps.create-report.outputs.report }}`
241241
});
242242
} else {
243243
await github.rest.issues.createComment({
244-
issue_number: context.issue.number,
245-
owner: context.repo.owner,
246-
repo: context.repo.repo,
247-
body: `${{ steps.create-report.outputs.report }}`,
244+
'issue_number': context.issue.number,
245+
'owner': context.repo.owner,
246+
'repo': context.repo.repo,
247+
'body': `${{ steps.create-report.outputs.report }}`
248248
});
249249
}
250250
@@ -257,10 +257,10 @@ jobs:
257257
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
258258
script: |
259259
github.rest.repos.createCommitComment({
260-
commit_sha: context.sha,
261-
owner: context.repo.owner,
262-
repo: context.repo.repo,
263-
body: '${{ steps.create-report.outputs.report }}'
260+
'commit_sha': context.sha,
261+
'owner': context.repo.owner,
262+
'repo': context.repo.repo,
263+
'body': '${{ steps.create-report.outputs.report }}'
264264
})
265265
266266
# Checkout coverage repository:

0 commit comments

Comments
 (0)