Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make include_file overrule include_ext #358

Closed
wants to merge 2 commits into from

Conversation

silverwind
Copy link
Contributor

@silverwind silverwind commented Nov 21, 2022

A file can now be in include_file without having its extension in include_ext, which I generally think is the expected behaviour because explicit filenames are more specific than extensions.

Fixes: #350

@silverwind silverwind changed the title Make include_file overrule include_ext Make include_file overrule include_ext Nov 21, 2022
Essentially, a file can now be in `include_file` without having its
extension in `include_ext`, which I generally think is the expected
behaviour because explicit filenames are more specific than extensions.

Fixes: air-verse#350
runner/engine.go Outdated Show resolved Hide resolved
@@ -251,7 +251,7 @@ func (e *Engine) watchPath(path string) error {
if excludeRegex {
break
}
if !e.isIncludeExt(ev.Name) {
if !e.isIncludeExt(ev.Name) && !e.checkIncludeFile(path) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the argument here may need to be ev.Name, I will re-verify.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the argument here may need to be ev.Name, I will re-verify.

I test the code below, it's ok:

if !e.isIncludeExt(ev.Name) && !e.checkIncludeFile(ev.Name) {

I don't know, why marked this pull request as draft, can i recreate new pull request base on the code?

@silverwind silverwind marked this pull request as draft December 13, 2022 12:52
@zhb127
Copy link
Contributor

zhb127 commented Apr 21, 2023

Is there anything problem with this pull request?
I see it is marked as draft?

@silverwind
Copy link
Contributor Author

I put it on draft because of #358 (comment), but then forgot about the PR.

@silverwind
Copy link
Contributor Author

Your PR does my suggested change so let's move to that one.

@silverwind silverwind closed this Apr 21, 2023
cosmtrek pushed a commit that referenced this pull request Sep 22, 2024
 (#416)

* feat: Make include_file overrule include_ext

* feat: Make include_file overrule include_ext unittest
jesses-code-adventures pushed a commit to jesses-code-adventures/air that referenced this pull request Sep 25, 2024
…ase_on: air-verse#358 (air-verse#416)

* feat: Make include_file overrule include_ext

* feat: Make include_file overrule include_ext unittest
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.

include_file should overrule include_ext
3 participants