Skip to content

Add shellcheck, minor bugfixes - #40

Open
paudley wants to merge 3 commits into
mainfrom
fix_checkers
Open

Add shellcheck, minor bugfixes#40
paudley wants to merge 3 commits into
mainfrom
fix_checkers

Conversation

@paudley

@paudley paudley commented Nov 15, 2025

Copy link
Copy Markdown
Owner

This pull request adds support for the shellcheck tool to the lint orchestration toolkit, including catalog integration, parsing logic, and tests. It also standardizes the SQL dialect configuration from postgresql to postgres across the codebase and documentation. The most important changes are grouped below:

Shellcheck tool integration

  • Added shellcheck to 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]
  • Implemented parse_shellcheck parser, 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]
  • Added unit tests for the shellcheck parser and catalog definition (tests/test_parsers.py, tests/test_shellcheck_tool.py, tests/test_tool_catalog_registry.py). [1] [2] [3] [4]

Configuration and documentation updates

  • Standardized SQL dialect from postgresql to postgres in 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

  • Updated project license metadata in pyproject.toml to use text and classifiers instead of a file reference (pyproject.toml).

Miscellaneous

  • Updated tool help summary to include shellcheck capabilities (tooling/catalog/docs/tool_help_summary.json).
  • Cleaned up unused scratch files from the catalog cache (tooling/catalog/cache.json).

Let me know if you want a deeper walkthrough of the shellcheck parser implementation or catalog integration!

@paudley paudley self-assigned this Nov 15, 2025
Copilot AI review requested due to automatic review settings November 15, 2025 01:19
@paudley paudley added bug Something isn't working enhancement New feature or request python:uv Pull requests that update python:uv code labels Nov 15, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 postgresql to postgres for 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)."

Copilot AI Nov 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"description": "Explicit shell dialect (bash, sh, dash, ksh, zsh, mksh)."
"description": "Explicit shell dialect (bash, sh, dash, ksh, busybox)."

Copilot uses AI. Check for mistakes.
Comment thread src/pyqa/parsers/misc.py
Comment on lines +336 to +337
return tuple(mapping_sequence(payload))
return tuple(mapping_sequence(payload))

Copilot AI Nov 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
return tuple(mapping_sequence(payload))
return tuple(mapping_sequence(payload))
return mapping_sequence(payload)
return mapping_sequence(payload)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request python:uv Pull requests that update python:uv code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants