Skip to content

Fix lint to avoid generating binlog file#1879

Merged
vitek-karas merged 2 commits intodotnet:mainfrom
vitek-karas:FixLint
Mar 11, 2021
Merged

Fix lint to avoid generating binlog file#1879
vitek-karas merged 2 commits intodotnet:mainfrom
vitek-karas:FixLint

Conversation

@vitek-karas
Copy link
Member

@vitek-karas vitek-karas commented Mar 10, 2021

Latest lint writes formatDiagnosticLog.binlong next to the solution file when running with --verbosity diagnostic. There's no way to redirect or disable this - dotnet/format#1041.

So this change disables --verbosity diagnostic for local runs of lint and adds it only to the CI (where the machine will clean the enlistment anyway).

Change dotnet#1867 breaks running lint on Windows since it will reformat pretty much all the source files in the repo (change of newline). So I reverted that change 74fb9a9.

Additionally latest lint writes formatDiagnosticLog.binlong next to the solution file when running with --verbosity diagnostic. There's no way to redirect or disable this - dotnet/format#1041.

So this change disables --verbosity diagnostic for local runs of lint and adds it only to the CI (where the machine will clean the enlistment anyway).
@MichalStrehovsky
Copy link
Member

Change #1867 breaks running lint on Windows since it will reformat pretty much all the source files in the repo (change of newline). So I reverted that change 74fb9a9.

I think this is because all files you have on disk are still checked out with LF line endings, despite the config change. There is probably some git command to fix that, but deleting your entire local clone and cloning again will fix that for sure.

I was hitting problems with the LF line endings too and I would have done Andy's change myself, but he pre-empted me (I was already asking about this in the pull request that introduced it #20 (comment)). I was happy to see it changed. Going back to LF would be a step back.

Git usually handles this correctly, and there are a number of problems with using LF locally on Windows.
@vitek-karas vitek-karas changed the title Fix lint on Windows and avoid generating binlog file Fix lint to avoid generating binlog file Mar 11, 2021
@vitek-karas
Copy link
Member Author

I'm changing this PR to only fix the binlog - the newlines is still broken for me.

Tried a new clone of the repo - lint still edits almost 600 files. I don't understand how it's supposed to work - to me there's a mismatch between GIT and lint/editorconfig.

@MichalStrehovsky
Copy link
Member

Yes, I got confused - the pull request I'm referencing in #20 (comment) is a change to gitattributes. I didn't realized we also have this setting in editorconfig and those two formats look too similar. I thought Andy changed gitattributes. We should change that one too to match.

@vitek-karas vitek-karas merged commit db52b51 into dotnet:main Mar 11, 2021
@vitek-karas vitek-karas deleted the FixLint branch March 11, 2021 12:37
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
Latest lint writes formatDiagnosticLog.binlong next to the solution file when running with --verbosity diagnostic. There's no way to redirect or disable this - dotnet/format#1041.

So this change disables --verbosity diagnostic for local runs of lint and adds it only to the CI (where the machine will clean the enlistment anyway).

Commit migrated from dotnet/linker@db52b51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants