Conditionals Fail in .editorconfig Files
See original GitHub issueI have an .editorconfig
file with the following conditional in it:
...omitted
##if (StyleCop)
##########################################
# StyleCop
##########################################
...omitted
#endif
...omitted
In my template.json
file, I have then added the following boolean option:
"StyleCop": {
"type": "parameter",
"datatype": "bool",
"description": "Adds and enforces StyleCop analyzers.",
"defaultValue": "true"
},
When I create a project using dotnet new
and turn off the StyleCop
option, the .editorconfig
file failes to remove the code above. Is there a bug with files that start with a .
or have no file extension?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Breaking change: EditorConfig files implicitly included - .NET
Reason for change ... The compiler now supports .editorconfig files, and they're implicitly included in a project if the file is in the...
Read more >c# - MSBuild - Treat Warnings from editorconfig as Errors ...
I set up an editorconfig file for my project and it works perfectly in my IDE and throws the right warnings. Examples: IDE0052...
Read more >EditorConfig settings - Visual Studio (Windows)
Settings in EditorConfig files let you maintain consistent coding styles and settings in a codebase, such as indent style, tab width, ...
Read more >Pipeline should fail if the code violates the .editorConfig file
Hello, I do have an editorConfig which works fine. Inside my IDE, if I violates the rules from that editorConfig, I received an...
Read more >Unable to open .editorconfig files - Developer Community
Attempting to add a new .editorconfig file to either Project or Solution results in a crash. This is using either the Default or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got both
.editorconfig
andDockerfile
working like so:@brettrowberry You’re awesome! Thanks.
There should still probably be some more support for common file extensions like
.editorconfig
andDockerfile
built into the templating engine. So I’ll leave this open but it’s nice to know we can add custom types.