Reputation: 298
I wanted that every *.swift
files must have the required texts.
Like so..
If the developer forgets to add it or has inputted the wrong values swiftlint
will give an error or warning upon compiling.
I have searched about file_header
but somehow it doesnt work properly.
Here is my swiftlint.yml
configuration
Upvotes: 4
Views: 1294
Reputation: 3708
You can use: required_pattern
file_header:
required_pattern: |
\/\/
\/\/ .*?\.swift
\/\/ (PROJECT_NAME.*?|Unit Tests)
\/\/
\/\/ (Created by .*? on .*?)
\/\/ Copyright © \d{4} COPY_RIGHT_NAME\. All rights reserved\.
\/\/
replace PROJECT_NAME
and COPY_RIGHT_NAME
with your values or change the pattern
Upvotes: 3