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

Parse hidden files #153

Open
loicreynier opened this issue Apr 14, 2022 · 4 comments
Open

Parse hidden files #153

loicreynier opened this issue Apr 14, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@loicreynier
Copy link
Contributor

I am not sure if this is intended or not, but hidden files are not formatted while running treefmt in the project root directory. I do not see why hidden files, which are generally configuration files should not be formatted.

Describe the solution you'd like

I would like to have hidden files formatted while running treefmt in the project root directory.

Describe alternatives you've considered

Currently hidden files can be formatted by passing them as command line arguments as in

treefmt .pre-commit-config.yaml
@loicreynier loicreynier added the enhancement New feature or request label Apr 14, 2022
@zimbatm
Copy link
Member

zimbatm commented Apr 15, 2022

It's something that comes default with the ignore crate. It's quite convenient as some of the hidden folders like .git wouldn't make sense to traverse.

I think this should stay the default but still look at hidden files IFF they are listed explicitly in the config.

@loicreynier
Copy link
Contributor Author

I agree with you, I did not think about the hidden directories and yes a better alternative is having the following configuration file:

[formatter.prettier]
command = "prettier"
options = ["--write"]
includes = [
    ".pre-commit-config.yaml",
    "*.yaml",
]

@sevenautumns
Copy link

@zimbatm please reopen. prettier is nice to format github workflow files. right now this does not seem to work for explicitly listed files in the config

@nokazn
Copy link
Contributor

nokazn commented Aug 18, 2023

I think this should stay the default but still look at hidden files IFF they are listed explicitly in the config.

I agree with your idea, but now even if hidden files are listed in includes option they are not formatted.
It would be good to specifying hidden files explicitly overrides this default behavior.

Edited: This issue seems to resolve for me by #250.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants