Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add new rule to enforce headers matched by regexp #1441

Merged
merged 2 commits into from
Aug 9, 2016

Conversation

ScottSWu
Copy link
Contributor

  • Checks for comments at the very beginning of files
  • Matches comment contents with header regexp
  • Ignores #! at the beginning of files

Relates to #155

cc: @alexeagle

- Checks for comments at the very beginning of files
- Ignores #!
- Matches comment contents with header regexp
export class Rule extends Lint.Rules.AbstractRule {
/* tslint:disable:object-literal-sort-keys */
public static metadata: Lint.IRuleMetadata = {
ruleName: "enforce-header",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call this rule "file-header" instead? "enforce" is a little redundant because all our rules enforce something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@adidahiya
Copy link
Contributor

overall looks pretty good, just left minor comments. @jkillian can you also take a look?

- Renamed folders and files
- Fixed syntax bug in tests
@jkillian
Copy link
Contributor

jkillian commented Aug 9, 2016

Looks fine to me, thanks @ScottSWu!

@jkillian jkillian merged commit 2cfdd33 into palantir:master Aug 9, 2016
@adidahiya adidahiya removed this from the TSLint v3.15 milestone Aug 9, 2016
soniro pushed a commit to soniro/tslint that referenced this pull request Aug 31, 2016
…ntir#1441)

- Checks for comments at the very beginning of files
- Ignores #!
- Matches comment contents with header regexp
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants