Skip to content

feat: make initial release#4

Merged
szymonmaszke merged 1 commit intomainfrom
3
Nov 11, 2025
Merged

feat: make initial release#4
szymonmaszke merged 1 commit intomainfrom
3

Conversation

@szymonmaszke
Copy link
Member

@szymonmaszke szymonmaszke commented Nov 11, 2025

Checklist

  • I agree to follow this project's Code of Conduct
  • I have read this project's Contributing Guide
  • I have created relevant issue(s) and linked them in the PR description

Closes #3

Copilot AI review requested due to automatic review settings November 11, 2025 10:07
@github-actions github-actions bot added src Source code updates config Configuration files updates tests Tests updates deps Dependencies updates security Security updates legal Legal documents updates python Python related changes feat Feature labels Nov 11, 2025
@szymonmaszke szymonmaszke merged commit 5d87470 into main Nov 11, 2025
61 checks passed
@szymonmaszke szymonmaszke deleted the 3 branch November 11, 2025 10:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the initial release of noqaexplain, a linter that enforces explanations for all ignored linting rules across multiple languages and linters.

Key Changes

  • Implements core linting functionality with two rules (ENQ0 and ENQ1) to check for missing or too-short explanations
  • Adds support for multiple languages/linters: Python (ruff, flake8), JavaScript/TypeScript (eslint), Rust (clippy), Dockerfiles (hadolint), YAML (yamllint), and Shell (shellcheck)
  • Provides CLI interface with configuration support via pyproject.toml or .noqaexplain.toml

Reviewed Changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/noqaexplain/init.py Updated package docstring
src/noqaexplain/_cli.py CLI entrypoint implementation with file discovery and configuration loading
src/noqaexplain/_default.py Default mappings for file extensions to noqa patterns
src/noqaexplain/_match.py File and line pattern matching logic for noqa comments
src/noqaexplain/_rule.py Rule definitions for NoExplain (ENQ0) and NoExplainShort (ENQ1)
tests/test_smoke.py Added smoke test for rules command
tests/test_rules.py Comprehensive CLI tests for pass/fail cases
tests/cases/* Test fixtures for various pass/fail scenarios
README.md Complete documentation with usage, configuration, and examples
.pre-commit-hooks.yaml Pre-commit hook configuration for noqaexplain
pyproject.toml Added lintkit and loadfig dependencies, CLI script entry point

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +67
for extension, noqas in self.config.get(
f"extend_{name}_mapping", {}
).items():
mapping[extension].extend(noqas) # pragma: no cover
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The default mapping comment has a typo. "noqas" should be "noqa" for consistency with the terminology used throughout the project.

Suggested change
for extension, noqas in self.config.get(
f"extend_{name}_mapping", {}
).items():
mapping[extension].extend(noqas) # pragma: no cover
for extension, noqa in self.config.get(
f"extend_{name}_mapping", {}
).items():
mapping[extension].extend(noqa) # pragma: no cover

Copilot uses AI. Check for mistakes.

lintkit.settings.name = "ENQ"

# enoqa: Import all rules to register them (side-effect)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

There's a spelling error in the comment. "enq" should be "# enq:" (with the # prefix and colon) to be clearer about the format, or just say "explanation" to be more general. The current wording is ambiguous.

Suggested change
# enoqa: Import all rules to register them (side-effect)
# enq: Import all rules to register them (side-effect)

Copilot uses AI. Check for mistakes.

...
```sh
> noqaxplain check
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

There's a typo in the shell command example. "noqaxplain" should be "noqaexplain".

Suggested change
> noqaxplain check
> noqaexplain check

Copilot uses AI. Check for mistakes.
for example:

```toml
[tool.noqexplain]
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

There's a typo in the TOML section header. "noqexplain" should be "noqaexplain".

Suggested change
[tool.noqexplain]
[tool.noqaexplain]

Copilot uses AI. Check for mistakes.

### Configuration

You can configure pynudger in `pyproject.toml` (or `.noqaexplain.toml`
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Incorrect reference in the comment. It says "pynudger" but should be "noqaexplain" since this is the noqaexplain project configuration.

Suggested change
You can configure pynudger in `pyproject.toml` (or `.noqaexplain.toml`
You can configure noqaexplain in `pyproject.toml` (or `.noqaexplain.toml`

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +86
def file(self, path: pathlib.Path) -> list[str]:
"""Match `path` against suffixes and names.

Warning:
Name patterns have higher priority and might override
suffix patterns.

Args:
path:
Path to be matched.

Returns:
List (possibly empty) of matching patterns.

"""
suffix_patterns = self.suffix_mapping.get(path.suffix, [])
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent terminology: the docstring says "noqa" but the actual check pattern could be extended to more than just "noqa" patterns. Consider using "linting rule disable patterns" or similar more general terminology, or clarify that "noqa" is used generically here.

Copilot uses AI. Check for mistakes.
#
# SPDX-License-Identifier: Apache-2.0

"""Module to match file and its line within file against noqa pattern(s)."""
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

There's a typo in the comment. "noqas" should be "noqa" (singular) to match the correct terminology used elsewhere in the codebase.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +28
from noqaexplain import ( # noqa: E402
_rule, # noqa: F401 # pyright: ignore[reportUnusedImport]
)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Import of '_rule' is not used.

Copilot uses AI. Check for mistakes.
Signed-off-by: szymonmaszke <github@maszke.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration files updates deps Dependencies updates feat Feature legal Legal documents updates python Python related changes security Security updates src Source code updates tests Tests updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create initial release

1 participant

Comments