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

Add support for a custom config directory #78

Open
rauhul opened this issue Dec 13, 2024 · 6 comments
Open

Add support for a custom config directory #78

rauhul opened this issue Dec 13, 2024 · 6 comments

Comments

@rauhul
Copy link
Member

rauhul commented Dec 13, 2024

This repo uses a lot of dotfiles for config. The customization is nice, but putting all of them at the repo root is very annoying and distracts viewers on the repo home page with a bunch of ci details.

Instead we should be able to set a custom configuration_directory relative to the repo root that contains the dot files. This could be limited to .github/configuration, but I'd rather it be not restricted. For instance I might want to include config files for other tools not used by workflows provided by repos in the same directory, and config for tools that aren't even visible to GitHub (actions).

@madrob
Copy link

madrob commented Dec 13, 2024

Another idea might be to do like pyproject.toml and all the config for each tool gets their own section but in the same file

@shahmishal
Copy link
Member

+1 on the idea of having this under .github dir. Maybe .github/workflows/<configuration_dir>

@MahdiBM
Copy link

MahdiBM commented Dec 13, 2024

Similar to #77 (comment), we need to make sure this plays well enough with the existing tools.

I mentioned accepting custom paths for .swift-format in sourcekit-lsp to @ahoppen, but he didn't think it's necessary.
I guess with such a feature in this CI repo, and with .swift-format possibly being moved to another place, we now have a reason for accepting custom paths for .swift-format in sourcekit-lsp, and I'd think @ahoppen will be OK with that considering we'll have a usecase for such a feature.

Still, it'll interrupt the VS Code users if the config files are moved to a different directory before sourcekit-lsp that is bundled in the toolchains recognizes that. Even then the repos will need to have custom .vscode/settings.json or .sourcekit-lsp/config.json files to be able to tell sourcekit-lsp where to look for the configs.

So ... I agree with the idea but not sure how easy it'll be.

@ahoppen
Copy link
Member

ahoppen commented Dec 13, 2024

A thing I really want to caution against is that if we put the .swift-format files outside of the package’s repo, users won’t be able to easily apply that format style locally because they are missing the configuration file. I am worried that this may significantly disrupt local development workflows.

@rauhul
Copy link
Member Author

rauhul commented Dec 16, 2024

This request is about a location for that file in the current repo but not at the repo root.

@ahoppen
Copy link
Member

ahoppen commented Dec 19, 2024

Maybe I’m misunderstanding but say you want to put your .swift-format file in your-project/.dotfiles/.swift-format. Then the GitHub workflow would be configured to use that .swift-format file. If a new contributor sees that the formatting was incorrect, the naïve solution would be to run swift-format -ir . on the repo. But that wouldn’t pick up the .swift-format file because it’s in a non-standard location. Similarly, SourceKit-LSP wouldn’t pick up the .swift-format configuration file for in-editor formatting.

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

No branches or pull requests

5 participants