Skip to content

Remove shebang-based file detection - #2701

Merged
DanielNoord merged 3 commits into
mainfrom
copilot/deprecate-inspection-of-shebang-lines
Oct 1, 2026
Merged

DanielNoord merged 3 commits into
mainfrom
copilot/deprecate-inspection-of-shebang-lines

Conversation

Copilot AI commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Shebang inspection opened extensionless files during file-type detection, adding significant overhead. Remove this fallback; extensionless shebang files are no longer automatically supported.

  • Detection: Remove shebang matching and file reads from Config.is_supported_filetype. Supported and blocked extensions, editor-backup handling, and FIFO checks remain unchanged.
  • Example: Config().is_supported_filetype("myscript") now returns False, even when the file starts with #!/usr/bin/env python. Use a supported extension or configure supported_extensions for other file types.

Copilot AI linked an issue Oct 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Deprecate inspection of shebang lines to improve performance Remove shebang-based file detection Oct 1, 2026
Copilot AI requested a review from DanielNoord October 1, 2026 19:45
Comment thread tests/unit/test_settings.py Outdated
assert not self.instance.is_supported_filetype(str(does_not_exist))

def test_is_supported_filetype_shebang(self, tmp_path: Path) -> None:
def test_is_supported_filetype_unsupported_shebang(self, tmp_path: Path) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot Remove this test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the shebang-specific test in commit 2016836.

Copilot AI requested a review from DanielNoord October 1, 2026 19:48
@DanielNoord
DanielNoord marked this pull request as ready for review October 1, 2026 19:57
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.41%. Comparing base (61071d7) to head (4edd9e1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2701      +/-   ##
==========================================
- Coverage   99.41%   99.41%   -0.01%     
==========================================
  Files          41       41              
  Lines        3235     3229       -6     
  Branches      689      689              
==========================================
- Hits         3216     3210       -6     
  Misses         12       12              
  Partials        7        7              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DanielNoord
DanielNoord added this pull request to the merge queue Oct 1, 2026
@DanielNoord
DanielNoord removed this pull request from the merge queue due to a manual request Oct 1, 2026
Copilot AI and others added 3 commits October 1, 2026 22:33
Co-authored-by: DanielNoord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: DanielNoord <13665637+DanielNoord@users.noreply.github.com>
@DanielNoord
DanielNoord force-pushed the copilot/deprecate-inspection-of-shebang-lines branch from 2016836 to 4edd9e1 Compare October 1, 2026 20:33
@DanielNoord
DanielNoord enabled auto-merge October 1, 2026 20:34
@DanielNoord
DanielNoord added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit d93953f Oct 1, 2026
37 checks passed
@DanielNoord
DanielNoord deleted the copilot/deprecate-inspection-of-shebang-lines branch October 1, 2026 20:49
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.

Deprecate inspection of shebang lines to determine if file is supported

2 participants