Add shellcheck, minor bugfixes - #40
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds shellcheck tool integration for shell script linting and standardizes the SQL dialect configuration from postgresql to postgres across the codebase.
- Added shellcheck tool with full catalog integration, parser implementation, and comprehensive test coverage
- Standardized SQL dialect from
postgresqltopostgresfor consistency with sqlfluff - Updated project license metadata format in pyproject.toml
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tooling/catalog/languages/shell/shellcheck.json | New shellcheck catalog definition with command mapping and options |
| tooling/catalog/docs/tool_help_summary.json | Added shellcheck capabilities summary |
| tooling/catalog/docs/sqlfluff_cmd_help.txt | Updated SQL dialect from postgresql to postgres |
| tooling/catalog/docs/shellcheck_help.txt | New shellcheck help documentation |
| tooling/catalog/docs/shellcheck_cmd_help.txt | New shellcheck command-specific help |
| tooling/catalog/cache.json | Updated checksum, added shellcheck files, removed scratch files |
| tests/test_tool_catalog_registry.py | Added shellcheck to expected tools list |
| tests/test_shellcheck_tool.py | New comprehensive test for shellcheck command building |
| tests/test_parsers.py | New test for shellcheck JSON parser |
| tests/test_config_loader.py | Updated SQL dialect default from postgresql to postgres |
| tests/test_config.py | Updated SQL dialect default from postgresql to postgres |
| tests/test_cli_config.py | Updated SQL dialect default from postgresql to postgres |
| src/pyqa/parsers/misc.py | Implemented parse_shellcheck with severity mapping and utility functions |
| src/pyqa/parsers/init.py | Exported parse_shellcheck function |
| src/pyqa/config/models/sections/execution.py | Changed SQL dialect default from postgresql to postgres |
| src/pyqa/cli/commands/lint/cli_models/overrides.py | Changed SQL dialect default from postgresql to postgres |
| pyproject.toml | Updated license metadata format |
| SELECTION.md | Updated tool count from 38 to 39, added shellcheck to catalog list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "name": "shell", | ||
| "type": "str", | ||
| "description": "Explicit shell dialect (bash, sh, dash, ksh, zsh, mksh)." |
There was a problem hiding this comment.
The shell dialect documentation lists 'zsh' and 'mksh' but the actual shellcheck help output (line 15 of shellcheck_help.txt) shows the supported dialects as 'sh, bash, dash, ksh, busybox'. Update this description to match the actual supported dialects: (bash, sh, dash, ksh, busybox).
| "description": "Explicit shell dialect (bash, sh, dash, ksh, zsh, mksh)." | |
| "description": "Explicit shell dialect (bash, sh, dash, ksh, busybox)." |
| return tuple(mapping_sequence(payload)) | ||
| return tuple(mapping_sequence(payload)) |
There was a problem hiding this comment.
The function has redundant logic. When payload is not a Mapping, or when it is a Mapping without 'comments', both branches call tuple(mapping_sequence(payload)). Simplify by removing the duplicate conversion: when comments is None, return mapping_sequence(payload) directly instead of wrapping it again with tuple(), since mapping_sequence already returns a tuple.
| return tuple(mapping_sequence(payload)) | |
| return tuple(mapping_sequence(payload)) | |
| return mapping_sequence(payload) | |
| return mapping_sequence(payload) |
This pull request adds support for the
shellchecktool to the lint orchestration toolkit, including catalog integration, parsing logic, and tests. It also standardizes the SQL dialect configuration frompostgresqltopostgresacross the codebase and documentation. The most important changes are grouped below:Shellcheck tool integration
shellcheckto the tool catalog, updated catalog cache, and included help documentation for its command-line options (tooling/catalog/cache.json,tooling/catalog/docs/shellcheck_cmd_help.txt,tooling/catalog/docs/shellcheck_help.txt,SELECTION.md). [1] [2] [3] [4] [5]parse_shellcheckparser, severity mapping, and utility functions for extracting diagnostics from shellcheck JSON output (src/pyqa/parsers/misc.py,src/pyqa/parsers/__init__.py). [1] [2] [3] [4]tests/test_parsers.py,tests/test_shellcheck_tool.py,tests/test_tool_catalog_registry.py). [1] [2] [3] [4]Configuration and documentation updates
postgresqltopostgresin configuration models, CLI overrides, tests, and documentation (src/pyqa/config/models/sections/execution.py,src/pyqa/cli/commands/lint/cli_models/overrides.py,tests/test_config.py,tests/test_config_loader.py,tests/test_cli_config.py,tooling/catalog/docs/sqlfluff_cmd_help.txt). [1] [2] [3] [4] [5] [6]Metadata and packaging
pyproject.tomlto use text and classifiers instead of a file reference (pyproject.toml).Miscellaneous
tooling/catalog/docs/tool_help_summary.json).tooling/catalog/cache.json).Let me know if you want a deeper walkthrough of the shellcheck parser implementation or catalog integration!