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

include_file should overrule include_ext #350

Open
silverwind opened this issue Nov 7, 2022 · 6 comments · May be fixed by #416
Open

include_file should overrule include_ext #350

silverwind opened this issue Nov 7, 2022 · 6 comments · May be fixed by #416

Comments

@silverwind
Copy link
Contributor

On master branch:

include_ext = ["go"]
include_file = ["main.go", "openapi.yaml"]

This config will not trigger a reload when openapi.yaml changes because its extension is missing in include_ext. I would say that the check via include_ext should be skipped in case of explicit inclusion via include_file.

@jamesgoodhouse
Copy link

Is include_file working at all for you? i have the following and cannot get a reload to happen when i update my go.mod file. It's like include_file is being completely ignored for me.

include_ext = ["go"]
include_file = ["go.sum"]

@silverwind
Copy link
Contributor Author

Yes it's working for me, but the extension needs to be in include_ext, so in your case:

include_ext = ["go", "sum"]
include_file = ["go.sum"]

silverwind added a commit to silverwind/air that referenced this issue 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: cosmtrek#350
@silverwind
Copy link
Contributor Author

#358 should fix this.

silverwind added a commit to silverwind/air that referenced this issue 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: cosmtrek#350
silverwind added a commit to silverwind/air that referenced this issue 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: cosmtrek#350
@jamesgoodhouse
Copy link

jamesgoodhouse commented Nov 21, 2022

i personally viewed the two as mutually exclusive. i would want to be able to include a single file and not have to add it to the include_ext option since I may not want every file with a given extension to be watched. in my example with the go.sum file, there's zero reason to add it to the include_file list since it's already in the include_ext file, so therefore include_file has no use case, unless i'm missing something?

i'm guessing that's what #358 is attempting to address?

@silverwind
Copy link
Contributor Author

Exactly, after #358, include_file will work, regardless whether the extension is in include_ext or not.

@johnmaguire
Copy link

johnmaguire commented Sep 5, 2023

Looks like #416 is the latest PR for this. Would love to get this in. I want config.toml to cause a reload, not all the example configs which also live in the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants