331 questions
0
votes
1
answer
41
views
editorconfig rule to enforce that namespace is set in all C# files
I want to set a rule in .editorconfig so that all C# files where namespace is not explicitly set should render an error.
I've added these:
dotnet_diagnostic.IDE0130.severity = error # Namespace does ...
1
vote
1
answer
81
views
How can I configure editors to follow Go's conventions for indentation with tabs & alignment with spaces?
I've read that Go uses
tabs for indentation
spaces for alignment
and this sounds like a great idea to resolve the tabs-versus-spaces fight and get the benefits that tabs promise without the problems ...
2
votes
1
answer
151
views
How to fix poor C# pattern formatting e.g. using editorconfig
I have the following code:
internal class Program
{
private static bool IsMatchingThing1(IThing thing)
{
return thing is
AThing {
Children: [
...
1
vote
0
answers
49
views
IntelliJ not using editorconfig: "Found illegal descriptor: {}"
IntelliJ's log has several lines like this one:
2025-04-24 09:52:05,878 [ 14206] WARN - #org.editorconfig.language.schema.parser.EditorConfigJsonSchemaParser - Found illegal descriptor: {}
I have ...
4
votes
0
answers
207
views
Visual Studio 2022 editorconfig exclusion.dic randomly stops working
In my solution I have an .editorconfig file with the following section:
[*.cs;*.md]
spelling_languages = en-us
spelling_checkable_types = strings, identifiers, comments
spelling_exclusion_path = ./....
0
votes
1
answer
88
views
Does EditorConfig has a rule to recognize Todo Comments?
I am working on a C# .NET Code Base, where a Custom Roslyn Analyzer is involved that analyze Existence of Todo Comments. We work with the IDE JetBrains Rider 2024.2.4.
Recently we integrated ...
0
votes
1
answer
81
views
What is overriding my .editorconfig rules?
I am currently facing a scenario where I have an .editorconfig file in the root directory with
[{*Test.cs,*Tests.cs}]
dotnet_diagnostic.CA1707.severity = none
This rule should disable the warning (...
2
votes
1
answer
655
views
How to use EditorConfig with Xcode?
With the release of Xcode 16 apple added support for EditorConfig:
Added support for EditorConfig. The editor now respects indentation
settings given in .editorconfig files. Xcode supports the ...
2
votes
2
answers
177
views
how to change code style format on flutter
I am developing with Flutter using Android Studio. When I try to format the code using the Cmd + Opt + L keys, it ends up like #1 below.
Is there a good way to make it look like #2?
//#1
@override
...
3
votes
2
answers
1k
views
Why Azure DevOps shows encoding change from utf-8 to Windows-1252?
We've noticed that for some users Azure DevOps in Pull Requests shows that encoding changes "utf-8 -> Windows-1252" (tooltip File encoding changed from utf-8 to Windows-1252). It happens ...
0
votes
0
answers
950
views
dotnet format keeps failing with 'Warnings were encountered while loading the workspace'
I have been trying to use dotnet format with an .editorconfig but it keeps on failing(details below).
Context:
In our repo we want to introduce formatters and linters. I decided to go ahead with ....
0
votes
0
answers
164
views
How to Suppress SA1633 in an External File Using StyleCop Analyzers with EditorConfig?
I'm using StyleCop analyzers with an EditorConfig in my C# project. I've suppressed the SA1633 rule by adding the following line to my EditorConfig:
dotnet_diagnostic.SA1633.severity = none
However, I'...
0
votes
1
answer
420
views
How do you order C# methods by their access modifiers using editorconfig or SonarQube?
We agreed that we should implement a rule to enforce that private methods are below public methods, as this is explained in Clean Code page 84/85: "Vertical Ordering". I don't see any option ...
0
votes
1
answer
583
views
Ignoring Entity Framework Migration files in EditorConfig
I have an EditorConfig file with the following content
root = true
# Generated Code
[{*.Generated.*.cs,*/Migrations/**,*/Scripts/**}]
generated_code = true
# C# files
[*.cs]
# Indentation and spacing
...
-1
votes
1
answer
262
views
Using editor config with the C# plugin VSCODE
I am trying to get linting to work on VS Code with an .editorconfig file in VS Code. I am not really at home in the C# ecosystem, so I tried following some guides. Like this article, most people ...
2
votes
0
answers
123
views
Force `this` pointer in C++ with Rider or .editorconfig?
Is there a way to force the use of the this pointer in C++ code with Rider or .editorconfig?
Example:
class Foo {
public:
void Bar() {
this->_x++; // forcing the `this->`
}
private:
...
0
votes
0
answers
172
views
Enforce code style from editorconfig in build in C++
In c# where is a setting "EnforceCodeStyleInBuild" that allows to fail build if code doesn't align with rules from .editorconfig.
C++ supports editorconfig as well, but I can't find a way ...
0
votes
0
answers
818
views
Ktlint-gradle - create/override lint rules
I am using the Ktlint-gradle library in my Android project.
I have recently upgraded to Gradle version 8.2.0 and ktlint version 12.0.3.
Post upgrade, some of the linting rules have changed and I'd ...
7
votes
2
answers
9k
views
Disable ktlint rules with ktlint-gradle version 12.0.2
I upgraded the ktlint-gradle plugin to version 12.0.2 and now it does not respect the settings in my modules' build.gradle where I previously disabled some rules like that:
ktlint {
ktlint....
3
votes
2
answers
196
views
Avoid Visual Studio autoformatting code in specific region
When using an .editorconfig to configure formatting and enabling automatic formatting (or running dotnet format, is there any way to suppress the formatting for a specific region/block of code?
E.g. I ...
1
vote
1
answer
1k
views
How to use the "editorconfig" in a .prettierrc in v3.0.3
I have prettier v3.0.3 and this .prettierrc config:
{
"editorconfig": true,
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"proseWrap&...
0
votes
1
answer
2k
views
Visual Studio checking naming convention for C++
I'm trying to configure my Visual Studio 022 to check and put warning when my compagny C++ code rules et naming conventions are not respected. The simple example is to prefix boolean with a "b&...
1
vote
0
answers
466
views
How to remove extra blank lines between if statement and opening brackets
I am writing a .editorconfig for a c# project. I want blank lines between an if statement and the opening brackets to be automatically removed.
Before formatting:
if (1 == 0)
{
// Do something
}
...
2
votes
2
answers
2k
views
How can I control whether opening curly brackets start on a new line with a .editorconfig in VS Code?
I am using VS Code as my editor. I have installed the 'EditorConfig for VS Code' extension. I have added an .editorconfig file to my root project. This is the code in the .editorconfig file:
root = ...
0
votes
0
answers
143
views
How to enforce rule SA1122 in visual studio editor?
I am using Visual Studio 2022. My project has .editorconfig file found next to the solution file. I want to set the severity of rule SA1122 to suggestion so that if I use "" Intellisense ...