Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for dotnet-format v5 #300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions __tests__/problemMatcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ describe("problemMatcher", () => {

describe("pattern", () => {
const reportOutput = [
" Formatting code files in workspace 'C:\\dev\\application\\application.sln'.",
" src\\ConsoleApp\\Program.cs(5,18): Fix whitespace formatting 1.",
" src\\ConsoleApp\\Program.cs(8,30): Fix whitespace formatting 2.",
" Formatted code file 'Program.cs'.",
" Format complete in 4451ms.",
"src\\ConsoleApp\\Program.cs(3,3): error WHITESPACE: Fix whitespace formatting. Insert '\\s\\s'. [src\\ConsoleApp\\ConsoleApp.csproj]",
"src\\ConsoleApp\\Program.cs(1,1): warning IDE0161: Convert to file-scoped namespace [src\\ConsoleApp\\ConsoleApp.csproj]",
];

let pattern: ProblemPattern;
Expand All @@ -39,14 +36,18 @@ describe("problemMatcher", () => {

it("matches violation details", () => {
expect(results[0][pattern.file]).toEqual("src\\ConsoleApp\\Program.cs");
expect(results[0][pattern.line]).toEqual("5");
expect(results[0][pattern.column]).toEqual("18");
expect(results[0][pattern.message]).toEqual("Fix whitespace formatting 1.");
expect(results[0][pattern.line]).toEqual("3");
expect(results[0][pattern.column]).toEqual("3");
expect(results[0][pattern.severity]).toEqual("error");
expect(results[0][pattern.code]).toEqual("WHITESPACE");
expect(results[0][pattern.message]).toEqual("Fix whitespace formatting. Insert '\\s\\s'.");

expect(results[1][pattern.file]).toEqual("src\\ConsoleApp\\Program.cs");
expect(results[1][pattern.line]).toEqual("8");
expect(results[1][pattern.column]).toEqual("30");
expect(results[1][pattern.message]).toEqual("Fix whitespace formatting 2.");
expect(results[1][pattern.line]).toEqual("1");
expect(results[1][pattern.column]).toEqual("1");
expect(results[1][pattern.severity]).toEqual("warning");
expect(results[1][pattern.code]).toEqual("IDE0161");
expect(results[1][pattern.message]).toEqual("Convert to file-scoped namespace");
});
});
});
Loading