-
Notifications
You must be signed in to change notification settings - Fork 41
Expendable Properties
Michael Ketting edited this page Jan 2, 2024
·
8 revisions
Within the headers configured in your license header definition files, you can use expandable properties, i.e., variables that are expanded when the header is inserted or updated.
The following properties are currently supported:
- %FullFileName% expands to the full file name (including directory path),
- %FileName% expands to the file name,
- %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime% expand to the respective file creation DateTime properties (time is in short time format),
- %CurrentYear%, %CurrentMonth%, %CurrentDay%, %CurrentTime% expand to the respective current DateTime properties (time is in short time format),
- %UserName% expands to the name (login) of the current user
- %Project% expands to the name of the containing project (since 1.4)
- %Namespace% expands to the first namespace used in the file (since 1.4)
- %UserDisplayName% expands to the full name of the current user (since 1.6)
For example
extensions: .cs
// This is a sample license header. %UserName%, %CurrentYear%-%CurrentMonth%-%CurrentDay%
will insert something similar to
// This is a sample license header. john.doe, 2011-12-23
into .cs files. Note that the properties are updated every time the header is reinserted.
This feature is available since release 1.3.
Note that with Git, the file's creation timestamp is populated based on the repositories clone date, not the Git log.