Skip to content

Check copyright headers for consistency #57624

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

Open
kevmoo opened this issue Sep 25, 2017 · 3 comments
Open

Check copyright headers for consistency #57624

kevmoo opened this issue Sep 25, 2017 · 3 comments
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-lint-request P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@kevmoo
Copy link
Member

kevmoo commented Sep 25, 2017

May be tricky to do without convention.

An idea: look for a starting commend (double-slash) block of one or more line. If one exists anywhere, make sure the same text exists everywhere

Be careful about https://en.wikipedia.org/wiki/Shebang_(Unix) though...

@kevmoo kevmoo added the type-enhancement A request for a change that isn't a bug label Sep 25, 2017
@bwilkerson
Copy link
Member

We need to be able to run lints on a single file without reference to other files (except those needed in order to analyze the file being linted). That precludes us from comparing the headers of multiple files.

Besides, for most projects what matters is not whether two arbitrary files have the same header, but whether every file has the appropriate header. I suspect what you really want is the ability to configure a lint rule such that it knows the header that ought to be used and compares that to each file. Unfortunately, we don't have configurable lint rules yet either.

@kevmoo
Copy link
Member Author

kevmoo commented Sep 25, 2017

Understood...just brainstorming 😄

@pq pq added type-enhancement A request for a change that isn't a bug and removed type-enhancement A request for a change that isn't a bug labels Jun 29, 2018
@pq
Copy link
Member

pq commented Jul 20, 2018

FWIW, we check for copyright headers in the linter code base like this:

https://github.com/dart-lang/linter/blob/1f6011389d52eb1086e80f5f9d987330f2046973/test/validate_headers_test.dart#L25-L32

Not elegant but it works.

We could do something similar in a lint if we made them configurable 1.


1 Looking at #57673, I see @a14n used file headers as a motivation for configurable lints.

@srawlins srawlins added the P3 A lower priority bug or feature request label Oct 11, 2022
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-lint-request P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants