Add wildcard (*) support for include_ext to watch all file extensions
- [x] Understand the issue: users want
include_ext = ["*"]to watch all file extensions - [x] Understand the concern: need to exclude the binary file (e.g.,
tmp/main) when using wildcard - [x] Explore codebase to understand file extension filtering logic
- [x] Implement wildcard (
*) support inisIncludeExtfunction - [x] Add
isBinPathhelper function to check if a file is the binary - [x] Ensure binary file is excluded when using wildcard to avoid reloading on binary creation
- [x] Add tests for wildcard extension support
- [x] Add test coverage for all
isBinPathreturn cases (including empty binPath) - [x] Extract
*toextWildcardconstant for better code maintainability - [x] Update documentation in
air_example.toml - [x] Run tests to validate changes
- [x] Request code review
- [x] Run security scan (no vulnerabilities found)
Original prompt
This section details on the original issue you should resolve
<issue_title>How to reload on all file extensions?</issue_title> <issue_description>Hi, Is there a wildcard that allows every file extension?
include_ext = ["*"]does not work for me, and removing it only allows Go files.I work with different file types that may change over time, so I don't want to have to edit the configuration file every time. When I use a wildcard, I can also copy the air toml config to new projects without having to change them.
🤟 </issue_description>
<agent_instructions>but also need to handle the creation of the bin file.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@xiantang Yes, but I'm worried that when I add *, it will also watch when tmp/main is created
- Fixes air-verse/air#830
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Codecov Report
:x: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| runner/util.go | 69.23% | 2 Missing and 2 partials :warning: |
| Files with missing lines | Coverage Δ | |
|---|---|---|
| runner/util.go | 79.65% <69.23%> (-0.49%) |
:arrow_down: |
... and 2 files with indirect coverage changes
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
also cover test for isBinPath return cases @copilot
also cover test for isBinPath return cases @copilot
Added TestIsBinPathEmptyBinPath test case to cover the empty binPath return case (d1a216f). The test verifies that isBinPath returns false when no entrypoint is configured.