Skip to content

Commit ade8222

Browse files
authored
Merge branch 'develop' into markdown-related-packages
Signed-off-by: Athan <[email protected]>
2 parents f2e8b56 + 9a18dc7 commit ade8222

File tree

21 files changed

+239
-83
lines changed

21 files changed

+239
-83
lines changed

.github/workflows/lint_random_files.yml

Lines changed: 46 additions & 5 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'
@@ -383,28 +416,31 @@ jobs:
383416
echo "" > "$out_benchmarks"
384417
echo "" > "$combined"
385418
419+
# Initialize an error flag:
420+
error=0
421+
386422
# Lint C source files:
387423
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep -E '\.c$' | grep -v -e '/examples' -e '/test' -e '/benchmark' | tr '\n' ' ')
388424
if [[ -n "${files}" ]]; then
389-
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_source}"
425+
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_source}" || error=1
390426
fi
391427
392428
# Lint C example files...
393429
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/examples/.*\.c$' | tr '\n' ' ')
394430
if [[ -n "${files}" ]]; then
395-
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_examples}" 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
396432
fi
397433
398434
# Lint C test fixtures files...
399435
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/test/fixtures/.*\.c$' | tr '\n' ' ')
400436
if [[ -n "${files}" ]]; then
401-
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_tests}" 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
402438
fi
403439
404440
# Lint C benchmark files...
405441
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '/benchmark/.*\.c$' | tr '\n' ' ')
406442
if [[ -n "${files}" ]]; then
407-
make lint-c-files FILES="${files}" CPPCHECK_FLAGS="--output-file=${out_benchmarks}" 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
408444
fi
409445
410446
# Combine all outputs into one file:
@@ -413,6 +449,11 @@ jobs:
413449
# Print the combined errors to the log:
414450
cat "$combined"
415451
452+
# If any linting command failed, exit with error:
453+
if [[ $error -ne 0 ]]; then
454+
exit 1
455+
fi
456+
416457
# Create sub-issue for C linting failures:
417458
- name: 'Create sub-issue for C lint failures'
418459
if: ( github.event.inputs.c != 'false' ) && failure() && contains(steps.*.outcome, 'failure') && contains(steps.lint-c.outcome, 'failure')

lib/node_modules/@stdlib/blas/ext/base/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ var ns = extblas;
114114
- <span class="signature">[`gsort2ins( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gsort2ins]</span><span class="delimiter">: </span><span class="description">simultaneously sort two strided arrays based on the sort order of the first array using insertion sort.</span>
115115
- <span class="signature">[`gsort2sh( N, order, x, strideX, y, strideY )`][@stdlib/blas/ext/base/gsort2sh]</span><span class="delimiter">: </span><span class="description">simultaneously sort two strided arrays based on the sort order of the first array using Shellsort.</span>
116116
- <span class="signature">[`gsorthp( N, order, x, strideX )`][@stdlib/blas/ext/base/gsorthp]</span><span class="delimiter">: </span><span class="description">sort a strided array using heapsort.</span>
117-
- <span class="signature">[`gsortins( N, order, x, stride )`][@stdlib/blas/ext/base/gsortins]</span><span class="delimiter">: </span><span class="description">sort a strided array using insertion sort.</span>
118-
- <span class="signature">[`gsortsh( N, order, x, stride )`][@stdlib/blas/ext/base/gsortsh]</span><span class="delimiter">: </span><span class="description">sort a strided array using Shellsort.</span>
117+
- <span class="signature">[`gsortins( N, order, x, strideX )`][@stdlib/blas/ext/base/gsortins]</span><span class="delimiter">: </span><span class="description">sort a strided array using insertion sort.</span>
118+
- <span class="signature">[`gsortsh( N, order, x, strideX )`][@stdlib/blas/ext/base/gsortsh]</span><span class="delimiter">: </span><span class="description">sort a strided array using Shellsort.</span>
119119
- <span class="signature">[`gsum( N, x, strideX )`][@stdlib/blas/ext/base/gsum]</span><span class="delimiter">: </span><span class="description">calculate the sum of strided array elements.</span>
120120
- <span class="signature">[`gsumkbn( N, x, strideX )`][@stdlib/blas/ext/base/gsumkbn]</span><span class="delimiter">: </span><span class="description">calculate the sum of strided array elements using an improved Kahan–Babuška algorithm.</span>
121121
- <span class="signature">[`gsumkbn2( N, x, strideX )`][@stdlib/blas/ext/base/gsumkbn2]</span><span class="delimiter">: </span><span class="description">calculate the sum of strided array elements using a second-order iterative Kahan–Babuška algorithm.</span>

lib/node_modules/@stdlib/blas/ext/base/cfill/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ console.log( x.get( 0 ).toString() );
259259

260260
<!-- /.examples -->
261261

262-
<!-- C interface documentation >
262+
<!-- C interface documentation. -->
263263

264264
* * *
265265

266-
<section class="C">
266+
<section class="c">
267267

268268
## C APIs
269269

lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@ interface Namespace {
21022102
* @param N - number of indexed elements
21032103
* @param order - sort order
21042104
* @param x - input array
2105-
* @param stride - stride length
2105+
* @param strideX - stride length
21062106
* @returns `x`
21072107
*
21082108
* @example
@@ -2125,7 +2125,7 @@ interface Namespace {
21252125
* @param N - number of indexed elements
21262126
* @param order - sort order
21272127
* @param x - input array
2128-
* @param stride - stride length
2128+
* @param strideX - stride length
21292129
* @returns `x`
21302130
*
21312131
* @example

lib/node_modules/@stdlib/blas/ext/base/dsortins/README.md

Lines changed: 123 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,133 @@ console.log( x );
148148

149149
<!-- /.examples -->
150150

151+
<!-- C interface documentation. -->
152+
153+
* * *
154+
155+
<section class="c">
156+
157+
## C APIs
158+
159+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
160+
161+
<section class="intro">
162+
163+
</section>
164+
165+
<!-- /.intro -->
166+
167+
<!-- C usage documentation. -->
168+
169+
<section class="usage">
170+
171+
### Usage
172+
173+
```c
174+
#include "stdlib/blas/ext/base/dsortins.h"
175+
```
176+
177+
#### stdlib_strided_dsortins( N, order, \*X, strideX )
178+
179+
Sorts a double-precision floating-point strided array using insertion sort.
180+
181+
```c
182+
double x[] = { 1.0, -2.0, 3.0, -4.0 };
183+
184+
stdlib_strided_dsortins( 2, -1.0, x, 1 );
185+
```
186+
187+
The function accepts the following arguments:
188+
189+
- **N**: `[in] CBLAS_INT` number of indexed elements.
190+
- **order**: `[in] double` sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
191+
- **X**: `[inout] double*` input array.
192+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
193+
194+
```c
195+
stdlib_strided_dsortins( const CBLAS_INT N, const double order, double *X, const CBLAS_INT strideX );
196+
```
197+
198+
<!--lint disable maximum-heading-length-->
199+
200+
#### stdlib_strided_dsortins_ndarray( N, order, \*X, strideX, offsetX )
201+
202+
<!--lint enable maximum-heading-length-->
203+
204+
Sorts a double-precision floating-point strided array using insertion sort and alternative indexing semantics.
205+
206+
```c
207+
double x[] = { 1.0, -2.0, 3.0, -4.0 };
208+
209+
stdlib_strided_dsortins_ndarray( 4, 1.0, x, 1, 0 );
210+
```
211+
212+
The function accepts the following arguments:
213+
214+
- **N**: `[in] CBLAS_INT` number of indexed elements.
215+
- **order**: `[in] double` sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
216+
- **X**: `[inout] double*` input array.
217+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
218+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
219+
220+
```c
221+
stdlib_strided_dsortins_ndarray( const CBLAS_INT N, const double order, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
222+
```
223+
224+
</section>
225+
226+
<!-- /.usage -->
227+
228+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
229+
230+
<section class="notes">
231+
232+
</section>
233+
234+
<!-- /.notes -->
235+
236+
<!-- C API usage examples. -->
237+
238+
<section class="examples">
239+
240+
### Examples
241+
242+
```c
243+
#include "stdlib/blas/ext/base/dsortins.h"
244+
#include <stdio.h>
245+
246+
int main( void ) {
247+
// Create a strided array:
248+
double x[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };
249+
250+
// Specify the number of elements:
251+
int N = 8;
252+
253+
// Specify a stride:
254+
int strideX = 1;
255+
256+
// Sort the array:
257+
stdlib_strided_dsortins( N, 1.0, x, strideX );
258+
259+
// Print the result:
260+
for ( int i = 0; i < 8; i++ ) {
261+
printf( "x[ %i ] = %lf\n", i, x[ i ] );
262+
}
263+
}
264+
```
265+
266+
</section>
267+
268+
<!-- /.examples -->
269+
270+
</section>
271+
272+
<!-- /.c -->
273+
151274
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
152275
153276
<section class="related">
154277
155-
* * *
156-
157278
## See Also
158279
159280
- <span class="package-name">[`@stdlib/blas/ext/base/dsort2ins`][@stdlib/blas/ext/base/dsort2ins]</span><span class="delimiter">: </span><span class="description">simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.</span>

lib/node_modules/@stdlib/blas/ext/base/zfill/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ console.log( x.get( 0 ).toString() );
259259

260260
<!-- /.examples -->
261261

262-
<!-- C interface documentation >
262+
<!-- C interface documentation. -->
263263

264264
* * *
265265

266-
<section class="C">
266+
<section class="c">
267267

268268
## C APIs
269269

0 commit comments

Comments
 (0)