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

Configuration file with configuration options #50

Open
yannjor opened this issue Aug 17, 2020 · 1 comment
Open

Configuration file with configuration options #50

yannjor opened this issue Aug 17, 2020 · 1 comment

Comments

@yannjor
Copy link

yannjor commented Aug 17, 2020

Would be nice for example to configure comment styles for different file extensions in a config file, instead of having to modify the source code. The config file could also be used to configure paths to ignore, or to configure the patterns that determine whether a file already has a license header.

Implementations of these features are included in the Nokia fork of addlicense. If you are interested in pulling only some parts, see the different branches there.

@willnorris
Copy link
Collaborator

willnorris commented Aug 10, 2021

Just leaving a note here that if we did want to add support for this, https://github.com/peterbourgon/ff might be a good approach that doesn't require much additional work. We'd also get support for environment variables for free, for those users that prefer that approach.

(for what it's worth, ff is used by https://github.com/sourcegraph/sourcegraph and https://github.com/tailscale/tailscale, that I know of off the top of my head)

mlevesquedion pushed a commit to openxla/stablehlo that referenced this issue Jan 18, 2024
For the most part, `addlicense` handles the file types that we care
about. It also doesn't handle some files that we (AFAICT) don't want
license headers in: `.md` and `.mlir` files, e.g. However, it doesn't
handle some files for which we may want license headers: `.bazel`, some
`.in` files, `.pdll`, `.td`, `.bazelignore`, `.bazelrc`, `.bazelversion`.
I think it's debatable whether we want license headers in `.gitignore`
and `.clang-format` files, and these are also not handled by `addlicense`.

For `.bazel`, `.pdll` and `.td`, I will see if I can contribute to
`addlicense` to handle those. For `.in` files (e.g.
`lit.site.cfg.py.in`), I think whether or not we want a license actually
depends on what the "true" type of the file is (e.g. `.py`). Supporting
that would likely require additional changes to `addlicense`. Actually,
I think it would be great if `addlicense` had some kind of extensibility
mechanism (google/addlicense#50).

Anyway, although imperfect I think on the whole this should help us
catch missing licenses in a lot of cases we care about.

Inspired by #1928
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