Skip to content

Conversation

@mshafer-NI
Copy link
Collaborator

Should fix #236

Turns out that on handling emergent issues (i.e., on a second round), the previous code attempted to process the line number and issue for all files but only in the current file (because re-running the lint was not filtered to the file under work).

@github-actions
Copy link
Contributor

Thank you for contributing! 👋

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 fixes issue #236 where the acknowledge-existing-violations command failed when processing multiple files. The bug occurred because lint re-runs during error acknowledgment were not filtered to the specific file being processed, causing line number and issue mismatches.

Key changes:

  • Modified get_errors_to_process calls to use [bad_file] instead of file_or_dir to scope lint operations to the current file
  • Added comprehensive test coverage for multiple file scenarios with both normal and aggressive modes
  • Updated pytest and linter configurations to exclude new test input files

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ni_python_styleguide/_acknowledge_existing_errors/init.py Fixed lint re-runs to filter to the specific file being processed (lines 92, 131)
tests/test_cli/test_acknowledge_existing_errors.py Added two new test functions to verify multiple file handling works correctly
tests/test_cli/acknowledge_existing_errors_multiple_files/input/acknowledge_function_signatures.py New test input file with various linting violations for testing
tests/test_cli/acknowledge_existing_errors_multiple_files/input/acknowledge_doc_lines.py New test input file with docstring and line length violations
tests/test_cli/acknowledge_existing_errors_multiple_files/input/acknowledge_blank_file.py New empty test input file
pyproject.toml Updated test and linter exclusions to ignore new test input files

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

pass

def add(self, o):
"""Provide an examples of doc strings that are too long.
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Grammar error: "an examples" should be "an example"

Suggested change
"""Provide an examples of doc strings that are too long.
"""Provide an example of doc strings that are too long.

Copilot uses AI. Check for mistakes.
pass

def add(self, o):
"""Provide an examples of doc strings that are too long.
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Grammar error: "an examples" should be "an example"

Copilot uses AI. Check for mistakes.


def method2():
"""Provide an examples of doc strings that are too long.
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Grammar error: "an examples" should be "an example"

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes switching all new instances of "Provide an examples" to "Provide an example"

@irwand irwand merged commit fa09a2c into ni:main Nov 14, 2025
25 checks passed
@mshafer-NI mshafer-NI deleted the dev/fix_acknowledge_on_multiple_files branch November 14, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nps acknowledge-existing-violations fails with IndexError: list index out of range

2 participants