-
Notifications
You must be signed in to change notification settings - Fork 4k
[ci] Use pixi and pre-commit for all linting jobs #6901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
caf9697
a214e9c
56f6464
2a40299
54e5b34
59e7ca3
ea80abc
44fedc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1,57 @@ | ||
| $settings = @{ | ||
| Severity = @( | ||
| 'Information', | ||
| 'Warning', | ||
| 'Error' | ||
| ) | ||
| IncludeDefaultRules = $true | ||
| # Additional rules that are disabled by default | ||
| Rules = @{ | ||
| PSAvoidExclaimOperator = @{ | ||
| Enable = $true | ||
| } | ||
| PSAvoidLongLines = @{ | ||
| Enable = $true | ||
| MaximumLineLength = 120 | ||
| } | ||
| PSAvoidSemicolonsAsLineTerminators = @{ | ||
| Enable = $true | ||
| } | ||
| PSPlaceCloseBrace = @{ | ||
| Enable = $true | ||
| NoEmptyLineBefore = $true | ||
| IgnoreOneLineBlock = $true | ||
| NewLineAfter = $false | ||
| } | ||
| PSPlaceOpenBrace = @{ | ||
| Enable = $true | ||
| OnSameLine = $true | ||
| NewLineAfter = $true | ||
| IgnoreOneLineBlock = $true | ||
| } | ||
| PSUseConsistentIndentation = @{ | ||
| Enable = $true | ||
| IndentationSize = 4 | ||
| PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline' | ||
| Kind = 'space' | ||
| } | ||
| PSUseConsistentWhitespace = @{ | ||
| Enable = $true | ||
| CheckInnerBrace = $true | ||
| CheckOpenBrace = $true | ||
| CheckOpenParen = $true | ||
| CheckOperator = $true | ||
| CheckSeparator = $true | ||
| CheckPipe = $true | ||
| CheckPipeForRedundantWhitespace = $true | ||
| CheckParameter = $true | ||
| IgnoreAssignmentOperatorInsideHashTable = $false | ||
| } | ||
| PSUseCorrectCasing = @{ | ||
| Enable = $true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Invoke-ScriptAnalyzer -Path ./ -Recurse -EnableExit -Settings $settings | ||
| $settings = @{ | ||
| Severity = @( | ||
| 'Information', | ||
| 'Warning', | ||
| 'Error' | ||
| ) | ||
| IncludeDefaultRules = $true | ||
| # Additional rules that are disabled by default | ||
| Rules = @{ | ||
| PSAvoidExclaimOperator = @{ | ||
| Enable = $true | ||
| } | ||
| PSAvoidLongLines = @{ | ||
| Enable = $true | ||
| MaximumLineLength = 120 | ||
| } | ||
| PSAvoidSemicolonsAsLineTerminators = @{ | ||
| Enable = $true | ||
| } | ||
| PSPlaceCloseBrace = @{ | ||
| Enable = $true | ||
| NoEmptyLineBefore = $true | ||
| IgnoreOneLineBlock = $true | ||
| NewLineAfter = $false | ||
| } | ||
| PSPlaceOpenBrace = @{ | ||
| Enable = $true | ||
| OnSameLine = $true | ||
| NewLineAfter = $true | ||
| IgnoreOneLineBlock = $true | ||
| } | ||
| PSUseConsistentIndentation = @{ | ||
| Enable = $true | ||
| IndentationSize = 4 | ||
| PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline' | ||
| Kind = 'space' | ||
| } | ||
| PSUseConsistentWhitespace = @{ | ||
| Enable = $true | ||
| CheckInnerBrace = $true | ||
| CheckOpenBrace = $true | ||
| CheckOpenParen = $true | ||
| CheckOperator = $true | ||
| CheckSeparator = $true | ||
| CheckPipe = $true | ||
| CheckPipeForRedundantWhitespace = $true | ||
| CheckParameter = $true | ||
| IgnoreAssignmentOperatorInsideHashTable = $false | ||
| } | ||
| PSUseCorrectCasing = @{ | ||
| Enable = $true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -SkipPublisherCheck | ||
| Invoke-ScriptAnalyzer -Path ./.ci -Recurse -EnableExit -Settings $settings |
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to reviewers: this exists to make it easy to activate the environment in the active shell. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| watch_file pixi.toml pixi.lock | ||
| eval "$(pixi shell-hook)" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # SCM syntax highlighting & preventing 3-way merges | ||
| pixi.lock merge=binary linguist-language=YAML linguist-generated=true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,22 +16,33 @@ concurrency: | |
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| COMPILER: 'gcc' | ||
| MAKEFLAGS: '-j4' | ||
| OS_NAME: 'linux' | ||
| PYTHON_VERSION: '3.13' | ||
| COMPILER: "gcc" | ||
| MAKEFLAGS: "-j4" | ||
| OS_NAME: "linux" | ||
| PYTHON_VERSION: "3.13" | ||
|
|
||
| jobs: | ||
| test: | ||
| name: ${{ matrix.task }} | ||
| lint: | ||
| name: lint | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 5 | ||
| submodules: false | ||
| - name: Setup pixi | ||
| uses: prefix-dev/[email protected] | ||
| with: | ||
| environments: lint | ||
| - name: Run pre-commit | ||
| run: pixi run lint | ||
|
|
||
| python-check-docs: | ||
| name: python-check-docs | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - task: lint | ||
| - task: check-docs | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
@@ -41,12 +52,13 @@ jobs: | |
| - name: Setup and run tests | ||
| shell: bash | ||
| run: | | ||
| export TASK="${{ matrix.task }}" | ||
| export TASK="check-docs" | ||
| export BUILD_DIRECTORY="$GITHUB_WORKSPACE" | ||
| export CONDA=${HOME}/miniforge | ||
| export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} | ||
| $GITHUB_WORKSPACE/.ci/setup.sh || exit 1 | ||
| $GITHUB_WORKSPACE/.ci/test.sh || exit 1 | ||
|
|
||
| r-check-docs: | ||
| name: r-package-check-docs | ||
| timeout-minutes: 60 | ||
|
|
@@ -83,10 +95,11 @@ jobs: | |
| echo "" | ||
| exit 1 | ||
| fi | ||
|
|
||
| all-static-analysis-jobs-successful: | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| needs: [test, r-check-docs] | ||
| needs: [lint, python-check-docs, r-check-docs] | ||
| steps: | ||
| - name: Note that all tests succeeded | ||
| uses: re-actors/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -463,3 +463,7 @@ dask-worker-space/ | |||
| *.pub | ||||
| *.rdp | ||||
| *_rsa | ||||
|
|
||||
| # pixi environments | ||||
| .pixi | ||||
| *.egg-info | ||||
|
||||
| *.egg-info/ |
Is it not working? Why was this *.egg-info necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this one. The line above already is saying "only look at files ending in
.ror.rmd" (ignoring casing).... what files like that are in./.pixi/?