Skip to content
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

Fix a code smell to test SonarQube #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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
25 changes: 25 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
# Trigger analysis when pushing to your main branches, and when creating a pull request.
push:
branches:
- main
- master
- develop
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]

name: Main Workflow
jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clones is recommended for improving the relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/[email protected]
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
5 changes: 3 additions & 2 deletions iiif_binder/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from os.path import exists
from typing import Optional

from pydantic import BaseModel, Path

Expand All @@ -13,7 +14,7 @@ class Config(BaseModel):


class Metadata(BaseModel):
title: str = None
title: Optional[str] = None
description: str = None
navdate: str = None
viewing_hint: str = "individuals"
Expand All @@ -22,7 +23,7 @@ class Metadata(BaseModel):


class Image(BaseModel):
url_id: str
url_id: str = None
url_path: str
width: int
height: int
Expand Down
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.projectKey=bitzl_iiif-binder
sonar.organization=bitzl

# relative paths to source directories. More details and properties are described
# at https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/
sonar.sources=.