Skip to content

Commit 53c4fad

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into ndarray-sdsnanmean
2 parents 08060b4 + b2909e4 commit 53c4fad

File tree

4,755 files changed

+159074
-52679
lines changed

Some content is hidden

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

4,755 files changed

+159074
-52679
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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: create_address_commit_comment_issues
21+
22+
# Workflow triggers:
23+
on:
24+
# Run the workflow daily at midnight UTC:
25+
schedule:
26+
- cron: '0 0 * * *'
27+
28+
# Allow the workflow to be manually run:
29+
workflow_dispatch:
30+
31+
# Global permissions:
32+
permissions:
33+
# Allow read-only access to the repository contents:
34+
contents: read
35+
36+
# Workflow jobs:
37+
jobs:
38+
39+
# Define a job for creating issues from commit comments...
40+
create_issues:
41+
42+
# Define a display name:
43+
name: 'Create issues from commit comments'
44+
45+
# Ensure the job does not run on forks:
46+
if: github.repository == 'stdlib-js/stdlib'
47+
48+
# Define the type of virtual host machine:
49+
runs-on: ubuntu-latest
50+
51+
# Define the sequence of job steps...
52+
steps:
53+
# Checkout the repository:
54+
- name: 'Checkout repository'
55+
# Pin action to full length commit SHA
56+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
57+
with:
58+
# Specify whether to remove untracked files before checking out the repository:
59+
clean: false
60+
61+
# Limit clone depth to the most recent commit:
62+
fetch-depth: 1
63+
64+
# Specify whether to download Git-LFS files:
65+
lfs: false
66+
timeout-minutes: 10
67+
68+
# Create issues from commit comments:
69+
- name: 'Create issues from commit comments'
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
72+
run: |
73+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_address_commit_comments_issues" 14
74+
timeout-minutes: 15

.github/workflows/lint_random_files.yml

Lines changed: 80 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,42 @@ jobs:
197197
198198
# Lint files against EditorConfig:
199199
- name: 'Lint against EditorConfig'
200+
id: lint-editorconfig
200201
run: |
201202
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' ' ')
202-
make lint-editorconfig-files FILES="${files}"
203+
make lint-editorconfig-files FILES="${files}" 2>&1 | tee lint_editorconfig_errors.txt
204+
205+
# Create sub-issue for EditorConfig lint failures:
206+
- name: 'Create sub-issue for EditorConfig lint failures'
207+
if: failure() && contains(steps.lint-editorconfig.outcome, 'failure')
208+
env:
209+
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
210+
run: |
211+
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
212+
cat << EOF > "$BODY_FILE"
213+
## EditorConfig Linting Failures
214+
215+
Linting failures were detected in the automated EditorConfig lint workflow run.
216+
217+
### Workflow Details
218+
219+
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
220+
- Type: EditorConfig Linting
221+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
222+
223+
### Error Details
224+
225+
\`\`\`
226+
$(cat lint_editorconfig_errors.txt)
227+
\`\`\`
228+
EOF
229+
230+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_sub_issue" \
231+
'Fix EditorConfig lint errors' \
232+
"$BODY_FILE" \
233+
"5156"
234+
235+
rm "$BODY_FILE"
203236
204237
# Lint Markdown files:
205238
- name: 'Lint Markdown files'
@@ -369,28 +402,56 @@ jobs:
369402
# Define the path to cppcheck configuration file for linting benchmarks:
370403
cppcheck_benchmarks_suppressions_list="${root}/etc/cppcheck/suppressions.benchmarks.txt"
371404
372-
# Lint C source files...
405+
# Define output files for each category:
406+
out_source="lint_c_errors_source.txt"
407+
out_examples="lint_c_errors_examples.txt"
408+
out_tests="lint_c_errors_tests.txt"
409+
out_benchmarks="lint_c_errors_benchmarks.txt"
410+
combined="lint_c_errors.txt"
411+
412+
# Initialize output files with empty content:
413+
echo "" > "$out_source"
414+
echo "" > "$out_examples"
415+
echo "" > "$out_tests"
416+
echo "" > "$out_benchmarks"
417+
echo "" > "$combined"
418+
419+
# Initialize an error flag:
420+
error=0
421+
422+
# Lint C source files:
373423
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep -E '\.c$' | grep -v -e '/examples' -e '/test' -e '/benchmark' | tr '\n' ' ')
374424
if [[ -n "${files}" ]]; then
375-
make lint-c-files FILES="${files}"
425+
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_source}" || error=1
376426
fi
377427
378428
# Lint C example files...
379429
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/examples/.*\.c$' | tr '\n' ' ')
380430
if [[ -n "${files}" ]]; then
381-
make lint-c-files FILES="${files}" CPPCHECK_SUPPRESSIONS_LIST="${cppcheck_examples_suppressions_list}"
431+
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_examples}" CPPCHECK_SUPPRESSIONS_LIST="${cppcheck_examples_suppressions_list}" || error=1
382432
fi
383433
384434
# Lint C test fixtures files...
385435
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/test/fixtures/.*\.c$' | tr '\n' ' ')
386436
if [[ -n "${files}" ]]; then
387-
make lint-c-files FILES="${files}" CPPCHECK_SUPPRESSIONS_LIST="${cppcheck_tests_fixtures_suppressions_list}"
437+
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_tests}" CPPCHECK_SUPPRESSIONS_LIST="${cppcheck_tests_fixtures_suppressions_list}" || error=1
388438
fi
389439
390440
# Lint C benchmark files...
391441
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/benchmark/.*\.c$' | tr '\n' ' ')
392442
if [[ -n "${files}" ]]; then
393-
make lint-c-files FILES="${files}" CPPCHECK_SUPPRESSIONS_LIST="${cppcheck_benchmarks_suppressions_list}"
443+
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_benchmarks}" CPPCHECK_SUPPRESSIONS_LIST="${cppcheck_benchmarks_suppressions_list}" || error=1
444+
fi
445+
446+
# Combine all outputs into one file:
447+
cat "$out_source" "$out_examples" "$out_tests" "$out_benchmarks" > "$combined"
448+
449+
# Print the combined errors to the log:
450+
cat "$combined"
451+
452+
# If any linting command failed, exit with error:
453+
if [[ $error -ne 0 ]]; then
454+
exit 1
394455
fi
395456
396457
# Create sub-issue for C linting failures:
@@ -402,20 +463,22 @@ jobs:
402463
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
403464
404465
cat << EOF > "$BODY_FILE"
405-
## C Linting Failures
466+
## C Linting Failures
467+
468+
Linting failures were detected in the automated lint workflow run.
469+
470+
### Workflow Details
406471
407-
Linting failures were detected in the automated lint workflow run.
472+
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
473+
- Type: C Linting
474+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
408475
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")
476+
### Error Details
413477
414-
### Error Details
415-
\`\`\`
416-
$(grep -B 1 -A 2 "style:\|warning:\|error:" <<< "${{ steps.lint-c.outputs.stderr }}")
417-
\`\`\`
418-
EOF
478+
\`\`\`
479+
$(grep -B 1 -A 2 "style:\|warning:\|error:" "lint_c_errors.txt")
480+
\`\`\`
481+
EOF
419482
420483
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_sub_issue" \
421484
'Fix C lint errors' \

0 commit comments

Comments
 (0)