diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml new file mode 100644 index 0000000..a488a6e --- /dev/null +++ b/.github/workflows/qodana_code_quality.yml @@ -0,0 +1,32 @@ +name: Qodana +on: + workflow_dispatch: + pull_request: + push: + branches: # Specify your branches here + - main # The 'main' branch + # - 'releases/*' # The release branches + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis + submodules: recursive + + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@27de2a744479d1d731934eeaf79287575ebc5dd3 # v2025.2.1 + with: + pr-mode: false + + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1941125997 }} + QODANA_ENDPOINT: 'https://qodana.cloud' diff --git a/pointer.go b/pointer.go index b4e35dd..79b5d1a 100644 --- a/pointer.go +++ b/pointer.go @@ -19,7 +19,7 @@ limitations under the License. package require import ( - lo "github.com/samber/lo" + "github.com/samber/lo" ) // NilPtr asserts that the given value is a nil pointer & returns it on success. diff --git a/pointer_test.go b/pointer_test.go index 467e8a2..63eda0a 100644 --- a/pointer_test.go +++ b/pointer_test.go @@ -3,7 +3,7 @@ package require_test import ( "testing" - assert "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/assert" "github.com/zimmermanncode/go-require" ) diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000..ac94cf0 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,49 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# + +################################################################################# +# WARNING: Do not store sensitive information in this file, # +# as its contents will be included in the Qodana report. # +################################################################################# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.recommended + +#Enable inspections +include: +# - name: + - name: CheckDependencyLicenses + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +# Quality gate. Will fail the CI/CD pipeline if any condition is not met +# severityThresholds - configures maximum thresholds for different problem severities +# testCoverageThresholds - configures minimum code coverage on a whole project and newly added code +# Code Coverage is available in Ultimate and Ultimate Plus plans + +failureConditions: + severityThresholds: + any: 0 # 15 + critical: 0 # 5 + +# testCoverageThresholds: +# fresh: 70 +# total: 50 + +#Specify Qodana linter for analysis (Applied in CI/CD pipeline) +linter: jetbrains/qodana-go:2025.2