-
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade dotnet to v6 + list_of_files for dotnet-format * Fixes * Fixes * Adding dotnet project files * Better .cs examples of bad code * Dotnet Upgrade project files (#1679) * Adding dotnet project files * Better .cs examples of bad code Co-authored-by: Alexandre Melotti <[email protected]> * Update doc * Adding .csproj files to sample_project_fixes * Added .sln info on linter_text property * Updated linter URL and added {{WORKSPACE}} CLI arg * Unifying vb and csharp projects into one single solution * Upgrade dotnet version on linter dockers * Really upgrade dotnet everywhere * Revert "Upgrade dotnet version on linter dockers" This reverts commit 995e9df. * Testing some Dockerfile configs * dotnet info * Trying to figure out dotnet version running on each test case * Checking root's workspace * Checking for tool versions * Removing dotnet-format install from Docker images * Updating linter versions and helps for dotnet-format * Reverting pre_coomands and configuring new dotnet format params * Forgot the "format" argument * Updating test reports * Fixed ERROR paths * Undowngrade DevSkim version * changelog * Remove version from DevSkim install line * Update TSQLLint version * fix dotnet format call * Using relative paths for worksapces * Detailed logging for debug * Revert "Using relative paths for worksapces" This reverts commit 92f57bc. * Disabling list_of_files mode. * Reverting back to list_of_files * Echoing linting command * Checking workspace path * Fixing descriptor parsing * Fix parse * Trying to figure out why --include is failing * Testing the exact computed command manually * Testing relative paths * Checking file contnt before testing linter * Checking editorconfig contents * Adding editorconfigs to validate whitespaces. Also reverting all changes to descriptors. * Re-enabling detailed logging * Adding style error to csharp_bad_02.cs. * Testing whitespace formatting for vb only * I don't know anymore * Fixed VB descriptor * A few mroe tests with editorconfigs * Fixed pre-command syntax * Testing lint without --include parameter * Trying several path styles * Testing some different paths * Testing echo * More tests * Checking versions * Adding dotnet --info * Upgrade to dotnet 7 and removed list_of_files * Revert some changes for --list-of-files * More experiments * Ops * Fixing malformed file * Whoa, python sux * Change dotnet command * Updating reports for tests * Success linters also format bad files * Separating good and bad test projects * Revert back to dotnet6 * Updated success report files * Removing unused import from DotnetFormatLinter.py * Upgrade to dotnet 7 * Removing csharpier version specification from install cli * Revert "Upgrade to dotnet 7" This reverts commit 7630633. * Updating changelog, removed 'list_of_files' for now Co-authored-by: nvuillam <[email protected]> Co-authored-by: Alexandre Melotti <[email protected]>
- Loading branch information
1 parent
88d912e
commit b549994
Showing
36 changed files
with
249 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace HelloWorld | ||
{ | ||
class Program { | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
|
||
namespace HelloWorld | ||
{ | ||
class Program | ||
{ | ||
static void Main (string[] args) | ||
{ | ||
Console.WriteLine ("Hello World!"); | ||
var value = 3 * 4 + 5; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace HelloWorld | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
16 changes: 10 additions & 6 deletions
16
.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
Results of dotnet-format linter (version 4.1.131201) | ||
Results of dotnet-format linter (version 000) | ||
See documentation on https://megalinter.github.io/descriptors/csharp_dotnet_format/ | ||
----------------------------------------------- | ||
|
||
[ERROR] .automation/test/csharp/csharp_bad_01.cs | ||
Formatting code files in workspace '.automation/test/csharp'. | ||
csharp/csharp_bad_01.cs(1,33): Fix whitespace formatting. | ||
Formatted code file '.automation/test/csharp/csharp_bad_01.cs'. | ||
Format complete in 1295ms. | ||
❌ [ERROR] .automation/test/csharp/csharp_bad_01.cs | ||
.automation/test/csharp/csharp_bad_01.cs(5,18): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\n\s\s\s\s'. [.automation/test/csharp/csharp_project.csproj] | ||
.automation/test/csharp/csharp_bad_02.cs(7,25): error WHITESPACE: Fix whitespace formatting. Delete 1 characters. [.automation/test/csharp/csharp_project.csproj] | ||
.automation/test/csharp/csharp_bad_02.cs(9,30): error WHITESPACE: Fix whitespace formatting. Delete 1 characters. [.automation/test/csharp/csharp_project.csproj] | ||
|
||
❌ [ERROR] .automation/test/csharp/csharp_bad_02.cs | ||
.automation/test/csharp/csharp_bad_01.cs(5,18): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\n\s\s\s\s'. [.automation/test/csharp/csharp_project.csproj] | ||
.automation/test/csharp/csharp_bad_02.cs(7,25): error WHITESPACE: Fix whitespace formatting. Delete 1 characters. [.automation/test/csharp/csharp_project.csproj] | ||
.automation/test/csharp/csharp_bad_02.cs(9,30): error WHITESPACE: Fix whitespace formatting. Delete 1 characters. [.automation/test/csharp/csharp_project.csproj] | ||
|
10 changes: 6 additions & 4 deletions
10
.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
Results of dotnet-format linter (version 4.1.131201) | ||
Results of dotnet-format linter (version 000) | ||
See documentation on https://megalinter.github.io/descriptors/csharp_dotnet_format/ | ||
----------------------------------------------- | ||
|
||
[SUCCESS] .automation/test/csharp/csharp_good_01.cs | ||
Formatting code files in workspace '.automation/test/csharp'. | ||
Format complete in 1181ms. | ||
✅ [SUCCESS] .automation/test/csharp/good/csharp_good_01.cs | ||
|
||
|
||
✅ [SUCCESS] .automation/test/csharp/good/csharp_good_02.cs | ||
|
||
|
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
.automation/test/sample_project_fixes/csharp_project/csharp_project.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.2.32630.192 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "csharp_project", "csharp_project\csharp_project.csproj", "{FF219771-9DBB-4FB0-8217-F77034831035}" | ||
EndProject | ||
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "vbdotnet_project", "vbdotnet_project\vbdotnet_project.vbproj", "{AF06A915-8734-4B54-836D-A0E2BAE228EB}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{FF219771-9DBB-4FB0-8217-F77034831035}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FF219771-9DBB-4FB0-8217-F77034831035}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FF219771-9DBB-4FB0-8217-F77034831035}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FF219771-9DBB-4FB0-8217-F77034831035}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{AF06A915-8734-4B54-836D-A0E2BAE228EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{AF06A915-8734-4B54-836D-A0E2BAE228EB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{AF06A915-8734-4B54-836D-A0E2BAE228EB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{AF06A915-8734-4B54-836D-A0E2BAE228EB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4DFF31ED-FADA-4A6E-B9D4-51D89C3C1FFC} | ||
EndGlobalSection | ||
EndGlobal |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
.automation/test/sample_project_fixes/vbdotnet_project/vbdotnet_project.vbproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>vb_projecty</RootNamespace> | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>vb_projecty</RootNamespace> | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Imports System | ||
|
||
Public Module Hello | ||
Public Sub Main( ) | ||
Console.WriteLine("hello, world" | ||
End Sub | ||
End Module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>vb_projecty</RootNamespace> | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Imports System | ||
|
||
Public Module Hello | ||
Public Sub Main() | ||
Console.WriteLine("hello, world") | ||
End Sub | ||
End Module |
24 changes: 16 additions & 8 deletions
24
.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
Results of dotnet-format linter (version 4.1.131201) | ||
Results of dotnet-format linter (version 000) | ||
See documentation on https://megalinter.github.io/descriptors/vbdotnet_dotnet_format/ | ||
----------------------------------------------- | ||
|
||
[ERROR] .automation/test/vbdotnet/vbdotnet_bad_1.vb | ||
Formatting code files in workspace '.automation/test/vbdotnet'. | ||
vbdotnet/vbdotnet_bad_1.vb(4,4): Fix whitespace formatting. | ||
vbdotnet/vbdotnet_bad_1.vb(4,20): Fix whitespace formatting. | ||
vbdotnet/vbdotnet_bad_1.vb(5,7): Fix whitespace formatting. | ||
Formatted code file '.automation/test/vbdotnet/vbdotnet_bad_1.vb'. | ||
Format complete in 1188ms. | ||
❌ [ERROR] .automation/test/vbdotnet/vbdotnet_bad_1.vb | ||
.automation/test/vbdotnet/vbdotnet_bad_1.vb(4,4): error WHITESPACE: Fix whitespace formatting. Insert '\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_1.vb(4,20): error WHITESPACE: Fix whitespace formatting. Delete 2 characters. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_1.vb(5,7): error WHITESPACE: Fix whitespace formatting. Insert '\s\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_2.vb(4,4): error WHITESPACE: Fix whitespace formatting. Insert '\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_2.vb(4,20): error WHITESPACE: Fix whitespace formatting. Delete 2 characters. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_2.vb(5,7): error WHITESPACE: Fix whitespace formatting. Insert '\s\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
|
||
❌ [ERROR] .automation/test/vbdotnet/vbdotnet_bad_2.vb | ||
.automation/test/vbdotnet/vbdotnet_bad_1.vb(4,4): error WHITESPACE: Fix whitespace formatting. Insert '\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_1.vb(4,20): error WHITESPACE: Fix whitespace formatting. Delete 2 characters. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_1.vb(5,7): error WHITESPACE: Fix whitespace formatting. Insert '\s\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_2.vb(4,4): error WHITESPACE: Fix whitespace formatting. Insert '\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_2.vb(4,20): error WHITESPACE: Fix whitespace formatting. Delete 2 characters. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
.automation/test/vbdotnet/vbdotnet_bad_2.vb(5,7): error WHITESPACE: Fix whitespace formatting. Insert '\s\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] | ||
|
10 changes: 6 additions & 4 deletions
10
.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
Results of dotnet-format linter (version 4.1.131201) | ||
Results of dotnet-format linter (version 000) | ||
See documentation on https://megalinter.github.io/descriptors/vbdotnet_dotnet_format/ | ||
----------------------------------------------- | ||
|
||
[SUCCESS] .automation/test/vbdotnet/vbdotnet_good_1.vb | ||
Formatting code files in workspace '.automation/test/vbdotnet'. | ||
Format complete in 1063ms. | ||
✅ [SUCCESS] .automation/test/vbdotnet/good/vbdotnet_good_1.vb | ||
|
||
|
||
✅ [SUCCESS] .automation/test/vbdotnet/good/vbdotnet_good_2.vb | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.