diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 952ddb9af2..06cbe35839 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,24 @@ jobs: - name: Check Prettier formatting run: npm run format + 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 + build: name: Build & Test runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 6b25014ba1..3f9ee43792 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,9 @@ src/webviews/webview-side/interactive-common/variableExplorerGrid.css src/webviews/webview-side/interactive-common/variableExplorerGrid.css.map src/webviews/webview-side/react-common/seti/seti.css src/webviews/webview-side/react-common/seti/seti.css.map +# 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 0000000000..d2382eb4b7 --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,69 @@ +# 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/**", +] + +# 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