Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: failed
---
  • Loading branch information
MeastroZI committed Dec 30, 2024
2 parents 73192e5 + 7995f33 commit 492bf45
Show file tree
Hide file tree
Showing 567 changed files with 34,096 additions and 2,834 deletions.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ REPL:
Statistics:
- changed-files:
- any-glob-to-all-files: '**/stats/**/*'

Tools:
- changed-files:
- any-glob-to-all-files: '**/_tools/**/*'
20 changes: 13 additions & 7 deletions .github/workflows/scripts/add_trailing_newlines
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set -o pipefail
# VARIABLES #

# List of file extensions to process:
extensions=("js" "mjs" "cjs" "json" "ts" "py" "jl" "R" "c" "h" "cpp" "hpp" "f" "sh" "awk" "html" "xml" "css" "md" "yml" "gypi" "bib" "tex")
extensions=("js" "mjs" "cjs" "json" "ts" "py" "jl" "R" "c" "h" "cpp" "hpp" "f" "sh" "awk" "html" "xml" "css" "md" "yml" "gyp" "gypi" "bib" "tex" "mk")


# FUNCTIONS #
Expand Down Expand Up @@ -70,13 +70,19 @@ main() {
convert_line_endings "$file"

extension="${file##*.}"
filename=$(basename "$file")

local match_found=false
for ext in "${extensions[@]}"; do
if [[ "$ext" == "$extension" ]]; then
match_found=true
break
fi
done
if [[ "$filename" == "Makefile" ]]; then
match_found=true
elif [[ "$file" == *.* ]]; then
for ext in "${extensions[@]}"; do
if [[ "$ext" == "$extension" ]]; then
match_found=true
break
fi
done
fi
if [[ "$match_found" == true ]]; then
if [[ "$(tail -c1 "$file"; echo x)" != $'\nx' ]]; then
echo "Adding newline to: $file"
Expand Down
9 changes: 9 additions & 0 deletions docs/git-notes/265cca5309edb232d2a96331430020fe789b600e.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: amend-message
---
docs: update namespace TypeScript declarations
PR-URL: #4266

Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
50 changes: 48 additions & 2 deletions etc/eslint/rules/stdlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ rules[ 'stdlib/capitalized-comments' ] = [ 'warn', {
'stdlib',
'throws'
]
} ];
}];

/**
* Enforce that return annotation values match actual output.
Expand Down Expand Up @@ -244,7 +244,7 @@ rules[ 'stdlib/empty-line-before-comment' ] = 'error';
* 'bar': true
* }]);
*/
rules[ 'stdlib/eol-open-bracket-spacing' ] = 'error';
rules[ 'stdlib/eol-open-bracket-spacing' ] = 'off'; // FIXME: temporarily disabled until bugs are fixed

Check warning on line 247 in etc/eslint/rules/stdlib.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: temporarily disabled until bugs...'

/**
* Require blockquotes to have `2` character indentation.
Expand Down Expand Up @@ -3861,6 +3861,52 @@ rules[ 'stdlib/jsdoc-unordered-list-marker-style' ] = [ 'error', '-' ];
*/
rules[ 'stdlib/jsdoc-main-export' ] = 'error';

/**
* Disallow spaces between a closing parenthesis or bracket and a nested object or array expression at the beginning of a line.
*
* @name line-closing-bracket-spacing
* @memberof rules
* @type {string}
* @default 'error'
*
* @example
* // Bad...
* var log = require( '@stdlib/console/log' );
*
* log({
* 'foo': true
* } );
*
* log([
* 1,
* 2,
* 3
* ] );
*
* log([{
* 'bar': true
* } ] );
*
* @example
* // Good...
* var log = require( '@stdlib/console/log' );
*
* log({
* 'foo': true
* });
*
* log([
* 1,
* 2,
* 3
* ]);
*
* log([{
* 'bar': true
* }]);
*/
rules[ 'stdlib/line-closing-bracket-spacing' ] = 'error';

/**
* Enforce that export statements are placed at the end of a file.
*
Expand Down
3 changes: 3 additions & 0 deletions lib/node_modules/@stdlib/_tools/eslint/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var eslint = rules;
- <span class="signature">[`empty-line-before-comment`][@stdlib/_tools/eslint/rules/empty-line-before-comment]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce empty lines before comments.</span>
- <span class="signature">[`eol-open-bracket-spacing`][@stdlib/_tools/eslint/rules/eol-open-bracket-spacing]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce that no spaces are present between an opening parenthesis or bracket and a nested object or array expression at the end of a line.</span>
- <span class="signature">[`first-unit-test`][@stdlib/_tools/eslint/rules/first-unit-test]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce that a tape file starts with the expected test.</span>
- <span class="signature">[`line-closing-bracket-spacing`][@stdlib/_tools/eslint/rules/line-closing-bracket-spacing]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce that no spaces are present between a closing parenthesis or bracket and a nested object or array expression at the beginning of a line.</span>
- <span class="signature">[`module-exports-last`][@stdlib/_tools/eslint/rules/module-exports-last]</span><span class="delimiter">: </span><span class="description">ESLint rule enforcing that export statements appear at the end of a file.</span>
- <span class="signature">[`namespace-export-all`][@stdlib/_tools/eslint/rules/namespace-export-all]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce that a namespace `index.js` exports all packages in the respective namespace directory.</span>
- <span class="signature">[`namespace-index-order`][@stdlib/_tools/eslint/rules/namespace-index-order]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce that modules in a namespace `index.js` file are listed in alphabetical order according to module name.</span>
Expand Down Expand Up @@ -377,6 +378,8 @@ console.log( getKeys( rules ) );

[@stdlib/_tools/eslint/rules/first-unit-test]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/first-unit-test

[@stdlib/_tools/eslint/rules/line-closing-bracket-spacing]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/line-closing-bracket-spacing

[@stdlib/_tools/eslint/rules/module-exports-last]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/module-exports-last

[@stdlib/_tools/eslint/rules/namespace-export-all]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/namespace-export-all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ function main( context ) {
) {
prevToken = source.getTokenBefore( args[ 0 ] );
tokenAfter = source.getFirstToken( args[ 0 ] );
if ( source.isSpaceBetween( prevToken, tokenAfter ) ) {
if (
prevToken.loc.end.line === tokenAfter.loc.end.line &&
source.isSpaceBetween( prevToken, tokenAfter )
) {
report( node, prevToken, tokenAfter );
}
} else if ( args[ 0 ].type === 'ArrayExpression' ) {
Expand All @@ -102,7 +105,10 @@ function main( context ) {
) {
prevToken = source.getTokenBefore( args[ 0 ] );
tokenAfter = source.getFirstToken( args[ 0 ] );
if ( source.isSpaceBetween( prevToken, tokenAfter ) ) {
if (
prevToken.loc.end.line === tokenAfter.loc.end.line &&
source.isSpaceBetween( prevToken, tokenAfter )
) {
report( node, prevToken, tokenAfter );
}
} else {
Expand All @@ -111,6 +117,7 @@ function main( context ) {
nextToken = source.getTokenAfter( tokenAfter );
if (
tokenAfter.loc.end.line !== nextToken.loc.end.line &&
prevToken.loc.end.line === tokenAfter.loc.end.line &&
source.isSpaceBetween( prevToken, tokenAfter )
) {
report( node, prevToken, tokenAfter );
Expand All @@ -131,7 +138,10 @@ function main( context ) {
prevToken = source.getFirstToken( node );
tokenAfter = source.getFirstToken( elem );

if ( source.isSpaceBetween( prevToken, tokenAfter ) ) {
if (
prevToken.loc.end.line === tokenAfter.loc.end.line &&
source.isSpaceBetween( prevToken, tokenAfter )
) {
report( node, prevToken, tokenAfter );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,79 @@ test = {
'var arrSum = sum( [ 1, 2, 3, 4 ] );'
].join( '\n' )
};
valid.push( test);
valid.push( test );

test = {
'code': [
' var log = require( \'@stdlib/console/log\' );',
' log( {} );'
].join( '\n' )
};
valid.push( test);
valid.push( test );

test = {
'code': [
'var arr = [ {}, 1, 2, 3, 4 ];'
].join( '\n' )
};
valid.push( test);
valid.push( test );

test = {
'code': [
' var log = require( \'@stdlib/console/log\' );',
' log(',
' {',
' \'a\': 1',
' }',
' );'
].join( '\n' )
};
valid.push( test );

test = {
'code': [
' var log = require( \'@stdlib/console/log\' );',
' log(',
' [',
' 1,',
' 2',
' ]',
' );'
].join( '\n' )
};
valid.push( test );

test = {
'code': [
' var log = require( \'@stdlib/console/log\' );',
' log(',
' [',
' {',
' \'a\': 1',
' }',
' ]',
' );'
].join( '\n' )
};
valid.push( test );

test = {
'code': [
' var arr = [',
' {',
' \'a\': 1',
' }',
'];'
].join( '\n' )
};
valid.push( test );

test = {
'code': [
' var x = array( [] );'
].join( '\n' )
};
valid.push( test );


// EXPORTS //
Expand Down
9 changes: 9 additions & 0 deletions lib/node_modules/@stdlib/_tools/eslint/rules/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,15 @@ setReadOnly( rules, 'jsdoc-typedef-typos', require( '@stdlib/_tools/eslint/rules
*/
setReadOnly( rules, 'jsdoc-unordered-list-marker-style', require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' ) );

/**
* @name line-closing-bracket-spacing
* @memberof rules
* @readonly
* @type {Function}
* @see {@link module:@stdlib/_tools/eslint/rules/line-closing-bracket-spacing}
*/
setReadOnly( rules, 'line-closing-bracket-spacing', require( '@stdlib/_tools/eslint/rules/line-closing-bracket-spacing' ) );

/**
* @name module-exports-last
* @memberof rules
Expand Down
Loading

0 comments on commit 492bf45

Please sign in to comment.