Skip to content

Commit

Permalink
chore: add sonarcloud to CI (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Oct 17, 2023
1 parent 9262cc9 commit 4826525
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
- name: Execute Pre-Commit
run: pre-commit run --show-diff-on-failure --color=always --all-files

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 3 additions & 1 deletion advanced_alchemy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ def process_result_value(self, value: datetime.datetime | None, dialect: Dialect
BigIntIdentity = BigInteger().with_variant(Integer, "sqlite")
"""A ``BigInteger`` variant that reverts to an ``Integer`` for unsupported variants."""

JsonB = _JSON().with_variant(PG_JSONB, "postgresql", "cockroachdb").with_variant(ORA_JSONB, "oracle")
JsonB = (
_JSON().with_variant(PG_JSONB, "postgresql").with_variant(ORA_JSONB, "oracle").with_variant(PG_JSONB, "cockroachdb")
)
"""A JSON type that uses native ``JSONB`` where possible and ``Binary`` or ``Blob`` as
an alternative.
"""
9 changes: 8 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ sonar.coverage.exclusions=\
**/__init__.py, \
examples/*.py, \
advanced_alchemy/alembic/templates/sync/env.py, \
tests/integration/conftest.py
tests/integration/conftest.py, \
advanced_alchemy/service/_sync.py, \
advanced_alchemy/service/_async.py, \
advanced_alchemy/extensions/litestar/plugins/init/config/asyncio.py, \
advanced_alchemy/extensions/litestar/plugins/init/config/sync.py
sonar.cpd.exclusions=\
advanced_alchemy/repository/_sync.py, \
advanced_alchemy/repository/_async.py, \
advanced_alchemy/service/_sync.py, \
advanced_alchemy/service/_async.py, \
advanced_alchemy/alembic/templates/sync/env.py, \
examples/*.py, \
examples/fastapi.py, \
tests/integration/conftest.py
sonar.projectName=Advanced Alchemy

0 comments on commit 4826525

Please sign in to comment.