SwiftFormat icon indicating copy to clipboard operation
SwiftFormat copied to clipboard

File header rule improvement

Open jesus-mg-ios opened this issue 8 months ago • 9 comments

We can improve it, by adding a way to insert variables and, using the created {created.year} optionally not from the file, but from the git.

If someone could instruct me on how to add the functionality (Where I can see this) I would try to add it.

(https://github.com/nicklockwood/SwiftFormat/blob/4bf475154c1c98dcdf751037f930f8e5c72597a4/Sources/Rules.swift#L4331)

Proposal:

Variables passed from the command line and added in .swiftformat as ${{variableName}}, the others can be {created.date.git} and {created.date.git.year} {modified.date.git} {modified.date.git.year}

jesus-mg-ios avatar Jun 04 '24 22:06 jesus-mg-ios