--check option does not work
See original GitHub issueThe new dotnet format --check
does not seem to work. I would assume that it only shows if the .editorconfig
rules have been applied or not but does not touch my files.
Steps to reproduce
1. Create a new project
dotnet new console -n Test
cd Test
2. Add .editorconfig
root = true
[*.cs]
csharp_new_line_before_open_brace = false
3. Run check option
dotnet format --check
Expected outcome
The dotnet format --check
command fails with non-zero exit code, beacse Program.cs
does not apply to the csharp_new_line_before_open_brace = false
rule.
Actual outcome
The Program.cs
file gets reformatted and the dotnet format --check` command completes successfully.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
mysql - Creating Views - WITH CHECK OPTION
1) I know with check option doesn't add records that do not satisfy the WHERE clause in the subselect query used to define...
Read more >Db2 for i SQL: WITH CHECK OPTION on a view
WITH CHECK OPTION is an optional clause on the CREATE VIEW statement. It specifies the level of checking when data is inserted or...
Read more >Views with the check option
The WITH CHECK OPTION clause indicates that any updated or inserted row to the view must be checked against the view definition, and...
Read more >25.5.4 The View WITH CHECK OPTION Clause
With no check option, the view WHERE clause is not checked, then checking recurses to underlying views, and applies the same rules.
Read more >Fix problems in Windows Search - Windows Client
Solution 1: Check for updates · Solution 2: Search and Indexing troubleshooter · Solution 3: Restart Windows Search · Solution 4: Reset Windows ......
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
Hi,
I was trying the same command: dotnet format --dry-run --check, but though the file was not modified, the command executed successfully. This was the rule I had: csharp_new_line_before_else = true
if (i == 0) { Console.WriteLine("i is 0"); }else { Console.WriteLine("i is not 0"); }
This is what I ran:
If I run just --check, it formats the page, when I run dotnet format --dry-run --check, nothing happens to the file and the errors are not reported as well. Any help is appreciated.
Thanks!
Sure, will do right away.