diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..794c779 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +permissions: + contents: read + pull-requests: read + +jobs: + qlty: + name: Qlty Check + runs-on: ubuntu-latest + timeout-minutes: 3 + + steps: + - name: Checkout code + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + + - name: Install qlty + uses: qltysh/qlty-action/install@06730ef41b86b073c3813c0fc07a0c734980ce5d + + - name: Run qlty check + run: qlty check + + - name: Run qlty code smells analysis + run: qlty smells diff --git a/.gitignore b/.gitignore index a4ba458..76dcc80 100644 --- a/.gitignore +++ b/.gitignore @@ -123,3 +123,9 @@ dmypy.json # Yarn cache .yarn/ +# Qlty cache directories +.qlty/cache +.qlty/logs +.qlty/out +.qlty/plugin_cachedir +.qlty/results diff --git a/.qlty/qlty.toml b/.qlty/qlty.toml new file mode 100644 index 0000000..ec825f4 --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,74 @@ +# Qlty Configuration +# Learn more at https://docs.qlty.sh +config_version = "0" + +# Plugins configuration +[[plugin]] +name = "actionlint" + +[[plugin]] +name = "trufflehog" + +[[plugin]] +name = "osv-scanner" + +# Source configuration +[[source]] +name = "default" +default = true + +# Exclusion patterns +exclude_patterns = [ + "node_modules/**", + "dist/**", + "build/**", + "coverage/**", + "**/*.min.js", + "**/*.min.css", + ".git/**", + ".venv/**", + "venv/**", + ".tox/**", + ".mypy_cache/**", + "**/__pycache__/**", +] + +# Code Smells Configuration +[smells] +mode = "block" + +[smells.boolean_logic] +enabled = true +threshold = 4 + +[smells.nested_control_flow] +enabled = true +threshold = 4 + +[smells.function_parameters] +enabled = true +threshold = 5 + +[smells.function_length] +enabled = true +threshold = 50 + +[smells.file_length] +enabled = true +threshold = 500 + +[smells.cognitive_complexity] +enabled = true +threshold = 15 + +[smells.duplicate_code] +enabled = true +threshold = 6 + +[smells.large_class] +enabled = true +threshold = 500 + +[smells.long_parameter_list] +enabled = true +threshold = 2