question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File headers: allow pattern matching or multiple allowable headers to support headers that must include a date

See original GitHub issue

I agree with @sharwell that it’s a pain to have a file header that includes a date. However, this might not always be avoidable. On one project, the header includes the year when the file was last updated.

It would be helpful if there was a way to allow, say, “Copyright © Flubbersoft, {year}” where year is defined as

\d{4}

(regular expression) or even

{ "2014", "2015" }

(array of permissible values)

I can make my own analyzer for this case if it’s rare, but would be interested to know whether it would be helpful to anyone else too.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Nihluscommented, Nov 13, 2017

@sharwell To me, then, it makes sense to extend the existing variable system in the json configuration to allow lists of values, along with a default value for the code fix. That solves the mentioned issue, and maintains the rigidity of the rule.

1reaction
sharwellcommented, Dec 2, 2016

At this point, the project already supports two specific and particularly practical use cases:

  1. Cases like the .NET Foundation uses, which minimizes the chances that a project header ever needs to be changed (no date included at all, but instead references another file containing the information).
  2. The strongest possible copyright protection under US copyright law, which is to use the year in which the project started as the copyright date and not change the year for future files (new files get back-dated).

I’ve seen other strategies employed, but they all seem to lose sight of the actual goals. When 95 years rolls around, one of three things will inevitably happen:

  1. You don’t care about the code enough to try and protect it anymore
  2. The code is so old no one cares to copy it anymore aside from fair use for historical preservation purposes
  3. We will all be dead so the whole thing is moot

My recommendation is to use the inflexibility of this tool as rationale to change the policy as it applies to your project. The company where I work tends to be especially inflexible on this subject, yet for this exact reason we ended up allowed to make this change on the C# projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access-Control-Allow-Headers - HTTP - MDN Web Docs
The Access-Control-Allow-Headers response header is used in response to a preflight request which includes the Access-Control-Request-Headers ...
Read more >
HTTP/1.1: Header Field Definitions
The Accept-Charset request-header field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of ......
Read more >
HTTP headers - MDN Web Docs - Mozilla
HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its...
Read more >
Request header field Access-Control-Allow-Headers is not ...
This is a request that uses the HTTP OPTIONS verb and includes several headers, one of which being Access-Control-Request-Headers listing ...
Read more >
Authorize with Shared Key (REST API) - Azure Storage
Retrieve all headers for the resource that begin with x-ms- , including the x-ms-date header. Convert each HTTP header name to lowercase. Sort ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found