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 Log Level Notice #245

Merged
merged 4 commits into from
Jan 23, 2022
Merged
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
8 changes: 7 additions & 1 deletion TestSolutions/TestSolution3.1/TestConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ namespace TestConsoleApp
{
class Program
{
public static public static int canBePrivate = "hello"; canBePrivate = "hello";

private static int unusedField = 0;

static void Main(string[] args)
{
var unusedVariable = 100;
var unusedVariable = 1;

Console.WriteLine(canBePrivate);
}
}
}
4 changes: 4 additions & 0 deletions TestSolutions/TestSolution5.0/TestConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ namespace TestConsoleApp
{
class Program
{
public static string canBePrivate = "hello";

private static int unusedField = 0;

static void Main(string[] args)
{
var unusedVariable = 1;

Console.WriteLine(canBePrivate);
}
}
}
18 changes: 9 additions & 9 deletions __tests__/expected_data/failure_report_issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"Column": 369,
"Line": 16,
"Message": "Field 'TooOpenField' can be made private",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "NotAccessedField.Global",
"FilePath": "/home/runner/work/ReShaperInspectionInCI/ReShaperInspectionInCI/ReShaperInspectionInCI/Controllers/WeatherForecastController.cs",
"Column": 383,
"Line": 16,
"Message": "Field 'TooOpenField' is assigned but its value is never used",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "NotAccessedField.Local",
Expand Down Expand Up @@ -100,15 +100,15 @@
"Column": 300,
"Line": 12,
"Message": "Class 'Program' is never instantiated",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "MemberCanBePrivate.Global",
"FilePath": "/home/runner/work/ReShaperInspectionInCI/ReShaperInspectionInCI/ReShaperInspectionInCI/Program.cs",
"Column": 441,
"Line": 19,
"Message": "Method 'CreateHostBuilder' can be made private",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "RedundantUsingDirective",
Expand Down Expand Up @@ -171,7 +171,7 @@
"Column": 595,
"Line": 23,
"Message": "Property 'Configuration' can be made private",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "UnusedAutoPropertyAccessor.Global",
Expand All @@ -195,23 +195,23 @@
"Column": 125,
"Line": 7,
"Message": "Property can be made init-only",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "PropertyCanBeMadeInitOnly.Global",
"FilePath": "/home/runner/work/ReShaperInspectionInCI/ReShaperInspectionInCI/ReShaperInspectionInCI/WeatherForecast.cs",
"Column": 172,
"Line": 9,
"Message": "Property can be made init-only",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "UnusedMember.Global",
"FilePath": "/home/runner/work/ReShaperInspectionInCI/ReShaperInspectionInCI/ReShaperInspectionInCI/WeatherForecast.cs",
"Column": 199,
"Line": 11,
"Message": "Property 'TemperatureF' is never used",
"Severity": "warning"
"Severity": "notice"
},
{
"TypeId": "UnusedAutoPropertyAccessor.Global",
Expand All @@ -227,6 +227,6 @@
"Column": 289,
"Line": 13,
"Message": "Property can be made init-only",
"Severity": "warning"
"Severity": "notice"
}
]
2 changes: 1 addition & 1 deletion src/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Issue {
}
}

export type Severity = 'warning' | 'error'
export type Severity = 'notice' | 'warning' | 'error'

export type IssueTypes = {
[Id: string]: Severity
Expand Down
1 change: 1 addition & 0 deletions src/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class Report {
switch (severity) {
case 'hint':
case 'suggestion':
return 'notice'
case 'warning':
return 'warning' //Severity info is not supported
default:
Expand Down