Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint_changed_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ jobs:
printf "${files}" | "${lint_repl_help}" --split=" "
fi

# Lint JavaScript files:
- name: 'Lint JavaScript files'

- name:
if: success() || failure()
run: |
# Determine root directory:
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/lint_random_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,22 @@ jobs:
fi
name="${name} -name '*.c'"
fi
if [ "${{ github.event.inputs.javascript }}" != "false" ]; then
if [ != "false" ]; then
if [ -n "${name}" ]; then
name="${name} -o"
fi
name="${name} -name '*.ts'"
fi
if [ "${{ github.event.inputs.python }}" != "false" ]; then
if [ != "false" ]; then
if [ -n "${name}" ]; then
name="${name} -o"
fi
name="${name} -name '*.py'"
fi
command="find lib/node_modules/@stdlib -type f \( ${name} \) |
grep -E '${{ github.event.inputs.pattern }}' |
grep -E ' |
grep -v '/fixtures/bad/' |
shuf -n ${{ github.event.inputs.num || 100 }} | tr '\n' ','"
shuf -n | tr '\n' ','"
files=$(eval ${command})

echo "files=$files" >> $GITHUB_OUTPUT
Expand All @@ -193,21 +193,21 @@ jobs:
lint_filenames="${root}/lib/node_modules/@stdlib/_tools/lint/filenames/bin/cli"

# Lint filenames:
echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | "${lint_filenames}"
echo | tr ',' '\n' | "${lint_filenames}"

# Lint files against EditorConfig:
- name: 'Lint against EditorConfig'
id: lint-editorconfig
run: |
set -o pipefail
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' ' ')
files=$(echo | tr ',' ' ')
make lint-editorconfig-files FILES="${files}" 2>&1 | tee lint_editorconfig_errors.txt

# Create sub-issue for EditorConfig lint failures:
- name: 'Create sub-issue for EditorConfig lint failures'
if: failure() && contains(steps.lint-editorconfig.outcome, 'failure')
env:
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
GITHUB_TOKEN: SECRETS.STDLIB_BOT_PAT_REPO_WRITE # ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE}}
run: |
strip_ansi() {
sed -r 's/\x1B\[[0-9;]*[mK]//g'
Expand All @@ -221,7 +221,7 @@ jobs:

### Workflow Details

- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Run:
- Type: EditorConfig Linting
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")

Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
- name: 'Lint Markdown files'
if: ( github.event.inputs.markdown != 'false' ) && ( success() || failure() )
run: |
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep -E '\.md$' | tr '\n' ' ')
files=$(echo| tr ',' '\n' | grep -E '\.md$' | tr '\n' ' ')
if [ -n "${files}" ]; then
make lint-markdown-files FAST_FAIL=0 FILES="${files}"
fi
Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
- name: 'Lint shell script files'
if: ( github.event.inputs.repl != 'false' ) && ( success() || failure() )
run: |
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep -vE '\.(js|md|json|ts|c|h)$' | while read -r file; do head -n1 "$file" | grep -q '^\#\!/usr/bin/env bash' && echo "$file"; done | tr '\n' ' ')
files=$(echo| tr ',' '\n' | grep -vE '\.(js|md|json|ts|c|h)$' | while read -r file; do head -n1 "$file" | grep -q '^\#\!/usr/bin/env bash' && echo "$file"; done | tr '\n' ' ')
if [[ -n "${files}" ]]; then
# Install shellcheck:
make install-deps-shellcheck
Expand All @@ -298,8 +298,8 @@ jobs:
make FILES="${files}" lint-shell-files
fi

# Lint JavaScript files:
- name: 'Lint JavaScript files'

- name:
id: lint-javascript
if: ( github.event.inputs.javascript != 'false' ) && ( success() || failure() )
env:
Expand All @@ -308,7 +308,7 @@ jobs:
ERR_FILE: ${{ github.workspace }}/lint_javascript_errors.txt
run: |
# Get JavaScript files to lint:
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '\.js$' | tr '\n' ' ')
files=$(echo | tr ',' '\n' | grep '\.js$' | tr '\n' ' ')

# Run the lint script:
if [ -n "${files}" ]; then
Expand All @@ -321,7 +321,7 @@ jobs:
- name: 'Create sub-issue for JavaScript lint failures'
if: failure() && contains(steps.lint-javascript.outcome, 'failure')
env:
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
GITHUB_TOKEN:
run: |
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
cat << EOF > "$BODY_FILE"
Expand All @@ -331,7 +331,7 @@ jobs:

### Workflow Details

- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Run:
- Type: JavaScript Linting
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")

Expand Down
6 changes: 3 additions & 3 deletions etc/eslint/rules/stdlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ rules[ 'stdlib/jsdoc-doctest-marker' ] = 'error';
* @name jsdoc-emphasis-marker
* @memberof rules
* @type {Array}
* @default [ 'error', '_' ]
* @default 'error'
* @see [emphasis-marker]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-emphasis-marker}
*
* @example
Expand Down Expand Up @@ -887,7 +887,7 @@ rules[ 'stdlib/jsdoc-example-require-spacing' ] = 'error';
* @name jsdoc-fenced-code-marker
* @memberof rules
* @type {Array}
* @default [ 'error', '`' ]
* @default [ 'error', '`']
* @see [fenced-code-marker]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-fenced-code-marker}
*
* @example
Expand Down Expand Up @@ -4244,7 +4244,7 @@ rules[ 'stdlib/no-multiple-empty-lines' ] = 'error';
* // => 'bigint'
*
* @example
* // Good...
* // Good...
* var BigInt = require( '@stdlib/bigint/ctor' );
*
* var x = BigInt( 123 );
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

// MODULES //

var stdlib = require( './main.js' );
const stdlib = require( './index.js' );


// EXPORTS //
Expand Down
Loading