Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望每个*.swift文件都必须有所需的文本。像这样。。
*.swift
如果开发者忘记添加或输入了错误的值swiftlint,编译时会给出错误或警告。
swiftlint
我已经搜索过,file_header但不知何故它不能正常工作。这是我的swiftlint.yml配置
file_header
swiftlint.yml
您可以使用:required_pattern
required_pattern
file_header: required_pattern: | \/\/ \/\/ .*?\.swift \/\/ (PROJECT_NAME.*?|Unit Tests) \/\/ \/\/ (Created by .*? on .*?) \/\/ Copyright © \d{4} COPY_RIGHT_NAME\. All rights reserved\. \/\/
用您的值替换PROJECT_NAME和COPY_RIGHT_NAME或更改模式
PROJECT_NAME
COPY_RIGHT_NAME