question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--check option does not work

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
francisminucommented, Apr 22, 2019

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:

dotnet format --check --dry-run Formatting code files in workspace ‘**\ConsoleApp1\ConsoleApp1.sln’. Formatting code files in project ‘ConsoleApp1’. Formatted code file ‘Program.cs’. Format complete.

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!

0reactions
francisminucommented, Apr 22, 2019

Sure, will do right away.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found