JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

File header style

Last modified: 28 January 2025

Using file headers for copyright notices and other identifying messages is a common practice. JetBrains Rider allows you to configure the default header text and automatically insert it into source files or use it to replace existing file headers.

You can configure file header style either in JetBrains Rider settings or in .editorconfig files and then add it to new files created with file templates and insert or replace file headers in existing files using code cleanup.

To make sure that files created and edited by different team members have the same header style, share file header settings with your team.

If you are not sure whether to configure file header style in JetBrains Rider settings or in .editorconfig files, consider the following table.

You can update file header in code that you have recently modified and are going to commit to Git. JetBrains Rider will run the selected cleanup profile before committing.

You can update file header every time you save changes in a file to make sure that your edits always comply with your code style. Note that this will only happen when you save changes explicitly with Ctrl0S or CtrlShift0S and will not be triggered by auto-saving. However, all auto-saved files are placed to the 'reformat and cleanup' queue and will be processed on the next explicit save.