Skip to content

[ci] check PowerShell scripts with PSScriptAnalyzer (part 3)#6710

Merged
jameslamb merged 4 commits intomasterfrom
ci/psanalizer-3
Nov 3, 2024
Merged

[ci] check PowerShell scripts with PSScriptAnalyzer (part 3)#6710
jameslamb merged 4 commits intomasterfrom
ci/psanalizer-3

Conversation

@StrikerRUS
Copy link
Collaborator

Linking full original PR: #6700.
Continuation of #6709.

Closed #6498.
Closed #6700.

This PR fixes all remaining PowerShell linting issues (PSAvoidLongLines, PSAvoidUsingCmdletAliases, PSPlaceCloseBrace, PSPossibleIncorrectComparisonWithNull).

Helpful links with info about splitting long lines:

}

Invoke-ScriptAnalyzer -Path "$env:BUILD_DIRECTORY/.ci" -Recurse -EnableExit -Settings $settings
Invoke-ScriptAnalyzer -Path ./ -Recurse -EnableExit -Settings $settings
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the consistency with other our linting scripts.

cpplint \
--filter=-build/c++11,-build/include_subdir,-build/header_guard,-whitespace/line_length \
--recursive ./src ./include ./R-package ./swig ./tests \
|| exit 1

mypy \
--config-file=./python-package/pyproject.toml \
./python-package \

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I agree, I think this makes the scripts a little easier to read.

@StrikerRUS StrikerRUS marked this pull request as ready for review November 1, 2024 11:11
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks! I left one very very small question, do whatever you want with it.

Co-authored-by: James Lamb <jaylamb20@gmail.com>
Copy link
Collaborator Author

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enclose more paths

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approving, thanks for all the additional quoting.

@jameslamb jameslamb merged commit e007191 into master Nov 3, 2024
@jameslamb jameslamb deleted the ci/psanalizer-3 branch November 3, 2024 19:12
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] enforce 'shellcheck' checks

2 participants