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

Option --cabal to read configuration from a .cabal file? #7

Open
andreasabel opened this issue Jun 16, 2022 · 4 comments
Open

Option --cabal to read configuration from a .cabal file? #7

andreasabel opened this issue Jun 16, 2022 · 4 comments

Comments

@andreasabel
Copy link

Context: We are considering switching from hs-tags to ghc-tags, just because maintaining hs-tags is a bit burdensome (uses the GHC API, thus, breaks with each new GHC version):

hs-tags has option --cabal to read configuration from the library section of a .cabal file.
I see that ghc-tags requires information such as default-languages and default-extensions to be duplicated in the ghc-tags.yaml configuration file. This is a bit error-prone and contradicts the DRY principle.

Maybe the --cabal option functionality could be ported from hs-tags to ghc-tags.

@arybczak
Copy link
Owner

arybczak commented Jun 16, 2022

Would passing --cabal ignore the .yaml file?

How complex is that functionality to port/maintain?

@andreasabel
Copy link
Author

Would passing --cabal ignore the .yaml file?

I haven't thought so far, but --cabal could pull in information which can then be omitted from the .yaml file. I wouldn't think it can fully replace it.

How complex is that functionality to port/maintain?

The core of that functionality seems rather small (the Cabal library does the heavy lifting):
https://github.com/agda/hs-tags/blob/4ccdfca089fa1fcc2e83c90a6d6930656911d699/Main.hs#L180-L201

@arybczak
Copy link
Owner

arybczak commented Jul 2, 2022

Let's say that using --cabal would ignore the config file ghc-tags.yaml and use the .cabal file instead, that should work out fine.

PRs are welcome 🙂

@andreasabel
Copy link
Author

I think one would still want to have the possibility to exclude files/directories from the tags generation, so completely replacing the --config file would not be desirable by a --cabal option. Rather, I'd think that the info drawn from the .cabal file would be complemented by the config file.

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

2 participants