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

What is the file_header rule about? #1492

Closed
Coeur opened this Issue May 4, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@Coeur

Coeur commented May 4, 2017

I do not understand what is the issue reported by the rule file_header.

//
//  ActivityModel.swift
//  English 24/7
//
//  Created by Antoine Cœur on 8/24/16.
//  Copyright © 2016 EF Education. All rights reserved.
//

/MyApp/ActivityModel.swift:6:5: warning: File Header Violation: Files should have consistent header comments. (file_header)

What does it mean?
Does it mean I need to change the Copyright year for all my files on every January 1st?

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri May 4, 2017

Collaborator

It validates that a certain string or regex should be present (or avoided) on the file header. By the default, this rule warns against occurrences of "Copyright".

You can see an example of how it can be configured on SwiftLint configuration file.

Collaborator

marcelofabri commented May 4, 2017

It validates that a certain string or regex should be present (or avoided) on the file header. By the default, this rule warns against occurrences of "Copyright".

You can see an example of how it can be configured on SwiftLint configuration file.

@Coeur

This comment has been minimized.

Show comment
Hide comment
@Coeur

Coeur May 5, 2017

OK, so the error message wasn't very informative. I would suggest to change it to something more like:

warning: File Header Violation: Header comments should match the project pattern. (file_header)

Coeur commented May 5, 2017

OK, so the error message wasn't very informative. I would suggest to change it to something more like:

warning: File Header Violation: Header comments should match the project pattern. (file_header)

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri May 5, 2017

Collaborator

It's just that the rule can enforce that a certain string/pattern must be avoided as well, so "should match the project pattern" doesn't feel right to me.

But I agree we can have a better message here.

Collaborator

marcelofabri commented May 5, 2017

It's just that the rule can enforce that a certain string/pattern must be avoided as well, so "should match the project pattern" doesn't feel right to me.

But I agree we can have a better message here.

@jpsim

This comment has been minimized.

Show comment
Hide comment
@jpsim

jpsim May 30, 2017

Collaborator

Suggestions?

Collaborator

jpsim commented May 30, 2017

Suggestions?

@Coeur

This comment has been minimized.

Show comment
Hide comment
@Coeur

Coeur May 30, 2017

  • "Header comments should match or exclude defined project patterns."
  • "Header comments should be consistent with project patterns."

Coeur commented May 30, 2017

  • "Header comments should match or exclude defined project patterns."
  • "Header comments should be consistent with project patterns."

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment