Rider New file header
Hi, When I create a new class file in rider, it gets created with a header comment. How do I disable this? I have never configured Rider to add the header.
the header looks like this
// <copyright file="filename.cs" company="PlaceholderCompany">Copyright (c) PlaceholderCompany. All rights reserved.</copyright>
Thanks
Please sign in to leave a comment.
Hello Ockert,
Would you mind checking, if you have an .editorconfig file in your project with `file_header_template` attribute?
Do you experience such an issue in a newly created template project?
Thank you in advance and have a nice day!
Hi, thank you for the response.
I checked, there is no .editorconfig file.
I have also checked under each parent directory,
this is somewhat old and stale, but just today my current rider started to add copy right headers, too.
I don't have any settings in the editorconfig and not templates defined, any Idea where this comes from?
Dirk Willrodt After all this time I still don't know how to solve this. Even after getting a new PC I am getting this stupid header when creating a new file
I did “fix” it by removing the `$HEADER$` variable from every specific file template I am using.
Hello,
This issue is caused by the StyleCop support feature. We have these related issues registered on our tracker:
It happens when the StyleCop.Analyzers NuGet package is added to a project. The issue is already fixed in the development branch. The fix will be available in the upcoming bugfix (2023.3.3).
As of now, you can use the workaround: delete $HEADER$ from the beginning of each file template (Settings | Editor | File Templates | C#)
Have a nice day!
Hi,
thanks for the update.
just FYI: the workaround does not work, if one creates a new file by moving a type to its own file (from a file with multiple classes for example).
Thank you for pointing it out. I see the same.
We will verify if the fix works in that scenario.
Have a nice day!
Hi,
The fix in version 2023.3.3 had been working great for me, but now I've upgraded to 2024.1 (Build #RD-241.14494.307) it has been reintroduced, on both manually created and moving a type to its own file.
I have no editorconfig.
Thanks,
Josh
Hello Joshua,
Thank you for your feedback. You can try these two workarounds to see if that helps:
Meanwhile, I'll check with team regarding this issue.
Have a nice day!
Hello Joshua,
Indeed, the issue still persists. Here is a corresponding bug on our tracker:
RSRP-496060 Default StyleCop header added to file when SA1633=None if stylecop.json without copyrightText present in solution because of higher priority of stylecop.json
Should you have any other questions or difficulties, please let me know.
Have a nice day!