From e2f8c5b0a723132ed83d35ff5480f298b8c1954c Mon Sep 17 00:00:00 2001 From: nvuillam Date: Sun, 24 Jul 2022 21:33:47 +0200 Subject: [PATCH 01/76] Upgrade dotnet to v6 + list_of_files for dotnet-format --- .automation/test/csharp/csharp_bad_02.cs | Bin 0 -> 1253 bytes .automation/test/csharp/csharp_good_02.cs | 12 +++++++++ .automation/test/vbdotnet/vbdotnet_bad_2.vb | 7 ++++++ .automation/test/vbdotnet/vbdotnet_good_2.vb | 7 ++++++ Dockerfile | 12 ++++----- flavors/dotnet/Dockerfile | 12 ++++----- .../csharp.megalinter-descriptor.yml | 9 ++++--- .../vbdotnet.megalinter-descriptor.yml | 7 +++--- megalinter/linters/DotnetFormatLinter.py | 23 +++++++++++++----- 9 files changed, 64 insertions(+), 25 deletions(-) create mode 100644 .automation/test/csharp/csharp_bad_02.cs create mode 100644 .automation/test/csharp/csharp_good_02.cs create mode 100644 .automation/test/vbdotnet/vbdotnet_bad_2.vb create mode 100644 .automation/test/vbdotnet/vbdotnet_good_2.vb diff --git a/.automation/test/csharp/csharp_bad_02.cs b/.automation/test/csharp/csharp_bad_02.cs new file mode 100644 index 0000000000000000000000000000000000000000..fb79c65b97fe903ba468562da5a86a7d34b0462f GIT binary patch literal 1253 zcmex=6kE^cmKJ|O{KK0!WiZUHd? zL17V5QBfX#aS1UI2_X?t5k_X9dKOkrR#r|CUT$6yFc5`Mf`SlQL_kDXL{LPOAIJ~^ z>fsj=f<@5aeJ`U{GLY6l7o$WMmd({C|W&0_Y_mfH)XTvaz#rFac$B z1sIqZnVDD_*;%2oj7&g>3$h6@uq!GViU^A-8#x9ha)>$=egG<$Vq^e%56K(`RyJl9 z21bxkT7nE9lbG0;VHN?65@cWzQZ#f76i#FPc7hT?D)snkuQxn@a+11Zi zo@DrEd{q4UhFhJtwoX$rUCS3=T=g~St4Y+X-sK&^&N82k-X3x`>FcnmSr(>jSN`#I z_)OV)^Ai8s!GZ9&cYB_qcCvJ)@ZSs?${&+jC4Nb{nWanp4a@ z@6PJ|pPmQYZJV?^Bq%6McUhQ6qDRY`o)fQL{m{O_XFPE#3-5tK{U2UoLLMv6z7n|@ zCM;EbvFfb1n@MfklFn&2G#5=13>4%!=ggBEJnvo;hFTf|%FZ zUGG;MY!p1TS?=nq$7g4G_U1g>7JVe-;VM_(NS8@=XE>%VnUdsF)_PK%CtSHlH%7GN zBa^>XZ~t-0unB*67ld#y=Ovu@xlE>K&G)rxJEK=D{kuzoVdcUJe>AgXIAsK?s$Ja= zzI^0(pnbyAJxk9OeOYD}(%unV!&F=MPwV8nBU8VGz1Ew3`9eT|&x-D>u12LLy~fw; z?j8KIiM`yP;iG`wjza&nF?uF#r}($})(6a)xne=~zby;bZjM?zr8+1or1$aHB5jre zXQnmBoE(1lR9M=W-)6CDnW`pgtgQ3z^~OgN@?s08Pia{d0j>ts@7MLCG+My zIXdfj%I>PW&SfPl*F;FFO;ccd7CF-`oTe9uz;Gw@}7dw(?S_k*Pz6I29D zui8A}JbFLEfa}h>n_>%96;{vv)1Sw-uXOW?y!@!2z6C3nuV}2DTmAG&m!$gISw(?? zq9F+@q&s}{i)-#W@R)y-m?Ec_%6@vL{bsAmur+^tcpMbY%l>;Sf3D?eyy@4wt7lv| zyuzgRn6z%eERWSfGZ&^iyl=WFmU?Hk{7GpsF3+6D3%FIITTkrddL`JBJ8g-?j3;wi zV|J8&ZPj0r$P_9$@7^yyPm%nupG99^i&%EsIe+u?S@nrwzvo4AX{eOv@~nQK_xQfz q?FP>zMHLpamnsDue>3m&1", - 'exit "${PIPESTATUS[0]}"', - ] + if file is not None: + # cli_lint_mode = file + file = os.path.basename(file) + dotnet_format_command = " ".join(super().build_lint_command(file)) + commands = [ + f'cd "{os.path.realpath(os.path.dirname(file))}" || exit 1', + dotnet_format_command + " | tee /dev/tty2 2>&1", + 'exit "${PIPESTATUS[0]}"', + ] + + else: + # cli_lint_mode = list_of_files or project + dotnet_format_command = " ".join(super().build_lint_command(None)) + commands = [ + dotnet_format_command + " | tee /dev/tty2 2>&1", + 'exit "${PIPESTATUS[0]}"', + ] return " && ".join(commands) From cf820a94a7ab587037ecca4bbe65264757bdf6e1 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Mon, 25 Jul 2022 08:52:18 +0200 Subject: [PATCH 02/76] Fixes --- CHANGELOG.md | 1 + megalinter/descriptors/csharp.megalinter-descriptor.yml | 6 +++--- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aab1e5432c..0eaa5ef1382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Note: Can be used with `megalinter/megalinter@beta` in your GitHub Action mega-l - Fixes about JSON Schema [(#1621)](https://github.com/oxsecurity/megalinter/issues/1621) - Add [checkmake](https://github.com/mrtazz/checkmake) to lint Makefile +- Upgrade dotnet to v6.x and update calls to dotnet-format ([#1642](https://github.com/oxsecurity/megalinter/issues/1642)) - Linter versions upgrades - [golangci-lint](https://golangci-lint.run/) from 1.47.0 to **1.47.1** on 2022-07-19 diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 0cabb8eb148..98fcbcf4049 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,16 +32,16 @@ linters: cli_lint_mode: list_of_files cli_lint_extra_args: - "--folder" - - "--check" + - "--verify-no-changes" - "--exclude" - "/" - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround for DotnetFormatLinter class behavior cli_lint_fix_remove_args: - - "--check" + - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet-format --folder --check --exclude / --include myfile.cs myfile2.cs" + - "dotnet-format --folder --verify-no-changes --exclude / --include myfile.cs myfile2.cs" - "dotnet-format --folder --exclude / --include myfile.cs myfile2.cs" # Fix install: dockerfile: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index cce93829cb7..1162f2783d6 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,16 +31,16 @@ linters: cli_lint_mode: list_of_files cli_lint_extra_args: - "--folder" - - "--check" + - "--verify-no-changes" - "--exclude" - "/" - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround to allow fix cli_lint_fix_remove_args: - - "--check" + - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet-format --folder --check --exclude / --include myfile.vb myfile2.vb" + - "dotnet-format --folder --verify-no-changes --exclude / --include myfile.vb myfile2.vb" - "dotnet-format --folder --exclude / --include myfile.vb myfile2.vb" install: dockerfile: From e794e493061bdeacfdc9664b3d6aec469394b687 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Mon, 25 Jul 2022 19:57:52 +0200 Subject: [PATCH 03/76] Fixes --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 5 ++--- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 98fcbcf4049..1031607a26a 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,7 +31,6 @@ linters: linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files cli_lint_extra_args: - - "--folder" - "--verify-no-changes" - "--exclude" - "/" @@ -41,8 +40,8 @@ linters: - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet-format --folder --verify-no-changes --exclude / --include myfile.cs myfile2.cs" - - "dotnet-format --folder --exclude / --include myfile.cs myfile2.cs" # Fix + - "dotnet-format --verify-no-changes --exclude / --include myfile.cs myfile2.cs" + - "dotnet-format --exclude / --include myfile.cs myfile2.cs" # Fix install: dockerfile: - RUN /usr/share/dotnet/dotnet tool install -g dotnet-format diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 1162f2783d6..cd362b9e148 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -30,7 +30,6 @@ linters: linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files cli_lint_extra_args: - - "--folder" - "--verify-no-changes" - "--exclude" - "/" @@ -40,8 +39,8 @@ linters: - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet-format --folder --verify-no-changes --exclude / --include myfile.vb myfile2.vb" - - "dotnet-format --folder --exclude / --include myfile.vb myfile2.vb" + - "dotnet-format --verify-no-changes --exclude / --include myfile.vb myfile2.vb" + - "dotnet-format --exclude / --include myfile.vb myfile2.vb" install: dockerfile: - RUN /usr/share/dotnet/dotnet tool install -g dotnet-format From c1406886a8e847eeb2911763b3726dcdca0f8746 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 09:18:35 -0300 Subject: [PATCH 04/76] Adding dotnet project files --- .automation/test/csharp/csharp_project.csproj | 10 ++++++++++ .automation/test/vbdotnet/vb_projecty.vbproj | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 .automation/test/csharp/csharp_project.csproj create mode 100644 .automation/test/vbdotnet/vb_projecty.vbproj diff --git a/.automation/test/csharp/csharp_project.csproj b/.automation/test/csharp/csharp_project.csproj new file mode 100644 index 00000000000..74abf5c9766 --- /dev/null +++ b/.automation/test/csharp/csharp_project.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/.automation/test/vbdotnet/vb_projecty.vbproj b/.automation/test/vbdotnet/vb_projecty.vbproj new file mode 100644 index 00000000000..3edb2ae4157 --- /dev/null +++ b/.automation/test/vbdotnet/vb_projecty.vbproj @@ -0,0 +1,9 @@ + + + + Exe + vb_projecty + net6.0 + + + From 35fca2bae8378f3fe01a10c9de8f37985c7ae12b Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 09:19:23 -0300 Subject: [PATCH 05/76] Better .cs examples of bad code --- .automation/test/csharp/csharp_bad_01.cs | Bin 1253 -> 173 bytes .automation/test/csharp/csharp_bad_02.cs | Bin 1253 -> 179 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/.automation/test/csharp/csharp_bad_01.cs b/.automation/test/csharp/csharp_bad_01.cs index fb79c65b97fe903ba468562da5a86a7d34b0462f..b0f430afd102d179f6bb6d620e0cbbf60d22798e 100644 GIT binary patch literal 173 zcmYL?u@1s83`BQ-h3V8T{6I$*29S^#Iv@tCwIWMNjN%jtq5L~dkigUVbnk98i4LzX z%N$04NP+D^GvkrH*GZFK;0?Il?8yu-NnN6VU$6R>Da(vcl?BfvvA3MI&f6U+IU5>V hbAO_K2aTql_fwM0CyCs5Z4uk#t{cW5SehzO-~&=?G2s9J literal 1253 zcmex=6kE^cmKJ|O{KK0!WiZUHd? zL17V5QBfX#aS1UI2_X?t5k_X9dKOkrR#r|CUT$6yFc5`Mf`SlQL_kDXL{LPOAIJ~^ z>fsj=f<@5aeJ`U{GLY6l7o$WMmd({C|W&0_Y_mfH)XTvaz#rFac$B z1sIqZnVDD_*;%2oj7&g>3$h6@uq!GViU^A-8#x9ha)>$=egG<$Vq^e%56K(`RyJl9 z21bxkT7nE9lbG0;VHN?65@cWzQZ#f76i#FPc7hT?D)snkuQxn@a+11Zi zo@DrEd{q4UhFhJtwoX$rUCS3=T=g~St4Y+X-sK&^&N82k-X3x`>FcnmSr(>jSN`#I z_)OV)^Ai8s!GZ9&cYB_qcCvJ)@ZSs?${&+jC4Nb{nWanp4a@ z@6PJ|pPmQYZJV?^Bq%6McUhQ6qDRY`o)fQL{m{O_XFPE#3-5tK{U2UoLLMv6z7n|@ zCM;EbvFfb1n@MfklFn&2G#5=13>4%!=ggBEJnvo;hFTf|%FZ zUGG;MY!p1TS?=nq$7g4G_U1g>7JVe-;VM_(NS8@=XE>%VnUdsF)_PK%CtSHlH%7GN zBa^>XZ~t-0unB*67ld#y=Ovu@xlE>K&G)rxJEK=D{kuzoVdcUJe>AgXIAsK?s$Ja= zzI^0(pnbyAJxk9OeOYD}(%unV!&F=MPwV8nBU8VGz1Ew3`9eT|&x-D>u12LLy~fw; z?j8KIiM`yP;iG`wjza&nF?uF#r}($})(6a)xne=~zby;bZjM?zr8+1or1$aHB5jre zXQnmBoE(1lR9M=W-)6CDnW`pgtgQ3z^~OgN@?s08Pia{d0j>ts@7MLCG+My zIXdfj%I>PW&SfPl*F;FFO;ccd7CF-`oTe9uz;Gw@}7dw(?S_k*Pz6I29D zui8A}JbFLEfa}h>n_>%96;{vv)1Sw-uXOW?y!@!2z6C3nuV}2DTmAG&m!$gISw(?? zq9F+@q&s}{i)-#W@R)y-m?Ec_%6@vL{bsAmur+^tcpMbY%l>;Sf3D?eyy@4wt7lv| zyuzgRn6z%eERWSfGZ&^iyl=WFmU?Hk{7GpsF3+6D3%FIITTkrddL`JBJ8g-?j3;wi zV|J8&ZPj0r$P_9$@7^yyPm%nupG99^i&%EsIe+u?S@nrwzvo4AX{eOv@~nQK_xQfz q?FP>zMHLpamnsDue>3m=8&Q9&(3v_gGP!JqCh{Mqy;ULLLE)_)b?luwhrtiMr)g(H+zASSX z0U`yq2hEH}_FgAVet|dOcC#llyd-srLSw#s)htt%8J{W(o=GD1meW>zyCWrML$g=o gKT^MgMpMuGDM{v&M8>{ryV!6kE^cmKJ|O{KK0!WiZUHd? zL17V5QBfX#aS1UI2_X?t5k_X9dKOkrR#r|CUT$6yFc5`Mf`SlQL_kDXL{LPOAIJ~^ z>fsj=f<@5aeJ`U{GLY6l7o$WMmd({C|W&0_Y_mfH)XTvaz#rFac$B z1sIqZnVDD_*;%2oj7&g>3$h6@uq!GViU^A-8#x9ha)>$=egG<$Vq^e%56K(`RyJl9 z21bxkT7nE9lbG0;VHN?65@cWzQZ#f76i#FPc7hT?D)snkuQxn@a+11Zi zo@DrEd{q4UhFhJtwoX$rUCS3=T=g~St4Y+X-sK&^&N82k-X3x`>FcnmSr(>jSN`#I z_)OV)^Ai8s!GZ9&cYB_qcCvJ)@ZSs?${&+jC4Nb{nWanp4a@ z@6PJ|pPmQYZJV?^Bq%6McUhQ6qDRY`o)fQL{m{O_XFPE#3-5tK{U2UoLLMv6z7n|@ zCM;EbvFfb1n@MfklFn&2G#5=13>4%!=ggBEJnvo;hFTf|%FZ zUGG;MY!p1TS?=nq$7g4G_U1g>7JVe-;VM_(NS8@=XE>%VnUdsF)_PK%CtSHlH%7GN zBa^>XZ~t-0unB*67ld#y=Ovu@xlE>K&G)rxJEK=D{kuzoVdcUJe>AgXIAsK?s$Ja= zzI^0(pnbyAJxk9OeOYD}(%unV!&F=MPwV8nBU8VGz1Ew3`9eT|&x-D>u12LLy~fw; z?j8KIiM`yP;iG`wjza&nF?uF#r}($})(6a)xne=~zby;bZjM?zr8+1or1$aHB5jre zXQnmBoE(1lR9M=W-)6CDnW`pgtgQ3z^~OgN@?s08Pia{d0j>ts@7MLCG+My zIXdfj%I>PW&SfPl*F;FFO;ccd7CF-`oTe9uz;Gw@}7dw(?S_k*Pz6I29D zui8A}JbFLEfa}h>n_>%96;{vv)1Sw-uXOW?y!@!2z6C3nuV}2DTmAG&m!$gISw(?? zq9F+@q&s}{i)-#W@R)y-m?Ec_%6@vL{bsAmur+^tcpMbY%l>;Sf3D?eyy@4wt7lv| zyuzgRn6z%eERWSfGZ&^iyl=WFmU?Hk{7GpsF3+6D3%FIITTkrddL`JBJ8g-?j3;wi zV|J8&ZPj0r$P_9$@7^yyPm%nupG99^i&%EsIe+u?S@nrwzvo4AX{eOv@~nQK_xQfz q?FP>zMHLpamnsDue>3m Date: Sun, 31 Jul 2022 12:43:19 -0300 Subject: [PATCH 06/76] Dotnet Upgrade project files (#1679) * Adding dotnet project files * Better .cs examples of bad code Co-authored-by: Alexandre Melotti --- .automation/test/csharp/csharp_bad_01.cs | Bin 1253 -> 173 bytes .automation/test/csharp/csharp_bad_02.cs | Bin 1253 -> 179 bytes .automation/test/csharp/csharp_project.csproj | 10 ++++++++++ .automation/test/vbdotnet/vb_projecty.vbproj | 9 +++++++++ 4 files changed, 19 insertions(+) create mode 100644 .automation/test/csharp/csharp_project.csproj create mode 100644 .automation/test/vbdotnet/vb_projecty.vbproj diff --git a/.automation/test/csharp/csharp_bad_01.cs b/.automation/test/csharp/csharp_bad_01.cs index fb79c65b97fe903ba468562da5a86a7d34b0462f..b0f430afd102d179f6bb6d620e0cbbf60d22798e 100644 GIT binary patch literal 173 zcmYL?u@1s83`BQ-h3V8T{6I$*29S^#Iv@tCwIWMNjN%jtq5L~dkigUVbnk98i4LzX z%N$04NP+D^GvkrH*GZFK;0?Il?8yu-NnN6VU$6R>Da(vcl?BfvvA3MI&f6U+IU5>V hbAO_K2aTql_fwM0CyCs5Z4uk#t{cW5SehzO-~&=?G2s9J literal 1253 zcmex=6kE^cmKJ|O{KK0!WiZUHd? zL17V5QBfX#aS1UI2_X?t5k_X9dKOkrR#r|CUT$6yFc5`Mf`SlQL_kDXL{LPOAIJ~^ z>fsj=f<@5aeJ`U{GLY6l7o$WMmd({C|W&0_Y_mfH)XTvaz#rFac$B z1sIqZnVDD_*;%2oj7&g>3$h6@uq!GViU^A-8#x9ha)>$=egG<$Vq^e%56K(`RyJl9 z21bxkT7nE9lbG0;VHN?65@cWzQZ#f76i#FPc7hT?D)snkuQxn@a+11Zi zo@DrEd{q4UhFhJtwoX$rUCS3=T=g~St4Y+X-sK&^&N82k-X3x`>FcnmSr(>jSN`#I z_)OV)^Ai8s!GZ9&cYB_qcCvJ)@ZSs?${&+jC4Nb{nWanp4a@ z@6PJ|pPmQYZJV?^Bq%6McUhQ6qDRY`o)fQL{m{O_XFPE#3-5tK{U2UoLLMv6z7n|@ zCM;EbvFfb1n@MfklFn&2G#5=13>4%!=ggBEJnvo;hFTf|%FZ zUGG;MY!p1TS?=nq$7g4G_U1g>7JVe-;VM_(NS8@=XE>%VnUdsF)_PK%CtSHlH%7GN zBa^>XZ~t-0unB*67ld#y=Ovu@xlE>K&G)rxJEK=D{kuzoVdcUJe>AgXIAsK?s$Ja= zzI^0(pnbyAJxk9OeOYD}(%unV!&F=MPwV8nBU8VGz1Ew3`9eT|&x-D>u12LLy~fw; z?j8KIiM`yP;iG`wjza&nF?uF#r}($})(6a)xne=~zby;bZjM?zr8+1or1$aHB5jre zXQnmBoE(1lR9M=W-)6CDnW`pgtgQ3z^~OgN@?s08Pia{d0j>ts@7MLCG+My zIXdfj%I>PW&SfPl*F;FFO;ccd7CF-`oTe9uz;Gw@}7dw(?S_k*Pz6I29D zui8A}JbFLEfa}h>n_>%96;{vv)1Sw-uXOW?y!@!2z6C3nuV}2DTmAG&m!$gISw(?? zq9F+@q&s}{i)-#W@R)y-m?Ec_%6@vL{bsAmur+^tcpMbY%l>;Sf3D?eyy@4wt7lv| zyuzgRn6z%eERWSfGZ&^iyl=WFmU?Hk{7GpsF3+6D3%FIITTkrddL`JBJ8g-?j3;wi zV|J8&ZPj0r$P_9$@7^yyPm%nupG99^i&%EsIe+u?S@nrwzvo4AX{eOv@~nQK_xQfz q?FP>zMHLpamnsDue>3m=8&Q9&(3v_gGP!JqCh{Mqy;ULLLE)_)b?luwhrtiMr)g(H+zASSX z0U`yq2hEH}_FgAVet|dOcC#llyd-srLSw#s)htt%8J{W(o=GD1meW>zyCWrML$g=o gKT^MgMpMuGDM{v&M8>{ryV!6kE^cmKJ|O{KK0!WiZUHd? zL17V5QBfX#aS1UI2_X?t5k_X9dKOkrR#r|CUT$6yFc5`Mf`SlQL_kDXL{LPOAIJ~^ z>fsj=f<@5aeJ`U{GLY6l7o$WMmd({C|W&0_Y_mfH)XTvaz#rFac$B z1sIqZnVDD_*;%2oj7&g>3$h6@uq!GViU^A-8#x9ha)>$=egG<$Vq^e%56K(`RyJl9 z21bxkT7nE9lbG0;VHN?65@cWzQZ#f76i#FPc7hT?D)snkuQxn@a+11Zi zo@DrEd{q4UhFhJtwoX$rUCS3=T=g~St4Y+X-sK&^&N82k-X3x`>FcnmSr(>jSN`#I z_)OV)^Ai8s!GZ9&cYB_qcCvJ)@ZSs?${&+jC4Nb{nWanp4a@ z@6PJ|pPmQYZJV?^Bq%6McUhQ6qDRY`o)fQL{m{O_XFPE#3-5tK{U2UoLLMv6z7n|@ zCM;EbvFfb1n@MfklFn&2G#5=13>4%!=ggBEJnvo;hFTf|%FZ zUGG;MY!p1TS?=nq$7g4G_U1g>7JVe-;VM_(NS8@=XE>%VnUdsF)_PK%CtSHlH%7GN zBa^>XZ~t-0unB*67ld#y=Ovu@xlE>K&G)rxJEK=D{kuzoVdcUJe>AgXIAsK?s$Ja= zzI^0(pnbyAJxk9OeOYD}(%unV!&F=MPwV8nBU8VGz1Ew3`9eT|&x-D>u12LLy~fw; z?j8KIiM`yP;iG`wjza&nF?uF#r}($})(6a)xne=~zby;bZjM?zr8+1or1$aHB5jre zXQnmBoE(1lR9M=W-)6CDnW`pgtgQ3z^~OgN@?s08Pia{d0j>ts@7MLCG+My zIXdfj%I>PW&SfPl*F;FFO;ccd7CF-`oTe9uz;Gw@}7dw(?S_k*Pz6I29D zui8A}JbFLEfa}h>n_>%96;{vv)1Sw-uXOW?y!@!2z6C3nuV}2DTmAG&m!$gISw(?? zq9F+@q&s}{i)-#W@R)y-m?Ec_%6@vL{bsAmur+^tcpMbY%l>;Sf3D?eyy@4wt7lv| zyuzgRn6z%eERWSfGZ&^iyl=WFmU?Hk{7GpsF3+6D3%FIITTkrddL`JBJ8g-?j3;wi zV|J8&ZPj0r$P_9$@7^yyPm%nupG99^i&%EsIe+u?S@nrwzvo4AX{eOv@~nQK_xQfz q?FP>zMHLpamnsDue>3m + + + Exe + net6.0 + enable + enable + + + diff --git a/.automation/test/vbdotnet/vb_projecty.vbproj b/.automation/test/vbdotnet/vb_projecty.vbproj new file mode 100644 index 00000000000..3edb2ae4157 --- /dev/null +++ b/.automation/test/vbdotnet/vb_projecty.vbproj @@ -0,0 +1,9 @@ + + + + Exe + vb_projecty + net6.0 + + + From 14c527d6ca5276ebc5b5577cee1bf245a6bad0b4 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Sun, 31 Jul 2022 18:08:20 +0200 Subject: [PATCH 07/76] Update doc --- CHANGELOG.md | 2 ++ megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 ++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e70d6a2bdf5..f031a885919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-linter.yml file, or with `oxsecurity/megalinter:beta` docker image +- Upgrade to dotnet 6.0 + `list_of_files` for dotnet-format CLI lint mode to improve performances (requires `.csproj` or `.vbproj` in the repo) + - Linter versions upgrades diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 1031607a26a..ef58c4619e4 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -26,6 +26,8 @@ linters: - class: DotnetFormatLinter linter_name: dotnet-format is_formatter: true + linter_text: | + dotnet-format requires a `.csproj` file to run correctly. linter_url: https://github.com/dotnet/format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index cd362b9e148..200aae8064a 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -26,6 +26,8 @@ linters: - class: DotnetFormatLinter linter_name: dotnet-format is_formatter: true + linter_text: | + dotnet-format requires a `.vbproj` file to run correctly. linter_url: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files From bfc1ba74e12cbf24b0f10b9ee376aedb2e84f428 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 14:40:13 -0300 Subject: [PATCH 08/76] Adding .csproj files to sample_project_fixes --- .../test/sample_project_fixes/csharp_project.csproj | 10 ++++++++++ .../test/sample_project_fixes/vb_projecty.vbproj | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 .automation/test/sample_project_fixes/csharp_project.csproj create mode 100644 .automation/test/sample_project_fixes/vb_projecty.vbproj diff --git a/.automation/test/sample_project_fixes/csharp_project.csproj b/.automation/test/sample_project_fixes/csharp_project.csproj new file mode 100644 index 00000000000..74abf5c9766 --- /dev/null +++ b/.automation/test/sample_project_fixes/csharp_project.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/.automation/test/sample_project_fixes/vb_projecty.vbproj b/.automation/test/sample_project_fixes/vb_projecty.vbproj new file mode 100644 index 00000000000..3edb2ae4157 --- /dev/null +++ b/.automation/test/sample_project_fixes/vb_projecty.vbproj @@ -0,0 +1,9 @@ + + + + Exe + vb_projecty + net6.0 + + + From 14d70b66d0b8781d8d2ef16dc1433e20ce08c999 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 14:49:15 -0300 Subject: [PATCH 09/76] Added .sln info on linter_text property --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 ++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 1031607a26a..817e78e2c3f 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -26,6 +26,8 @@ linters: - class: DotnetFormatLinter linter_name: dotnet-format is_formatter: true + linter_text: | + dotnet-format requires a `.sln` or `.csproj` file to run correctly. linter_url: https://github.com/dotnet/format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index cd362b9e148..11287823a0d 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -26,6 +26,8 @@ linters: - class: DotnetFormatLinter linter_name: dotnet-format is_formatter: true + linter_text: | + dotnet-format requires a `.sln` or `.vbproj` file to run correctly. linter_url: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files From 4433588ef737a840f322b83ad7c3a2321a5553a2 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 15:07:13 -0300 Subject: [PATCH 10/76] Updated linter URL and added {{WORKSPACE}} CLI arg --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 3 ++- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 817e78e2c3f..c08aa253fcb 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -28,11 +28,12 @@ linters: is_formatter: true linter_text: | dotnet-format requires a `.sln` or `.csproj` file to run correctly. - linter_url: https://github.com/dotnet/format + linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files cli_lint_extra_args: + - "{{WORKSPACE}}" - "--verify-no-changes" - "--exclude" - "/" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 11287823a0d..e3af2c1b40b 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -28,10 +28,12 @@ linters: is_formatter: true linter_text: | dotnet-format requires a `.sln` or `.vbproj` file to run correctly. - linter_url: https://github.com/dotnet/format + linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format + linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files cli_lint_extra_args: + - "{{WORKSPACE}}" - "--verify-no-changes" - "--exclude" - "/" From bec39b46a6b0282e659be30c9f0de04405ca3814 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 16:41:10 -0300 Subject: [PATCH 11/76] Unifying vb and csharp projects into one single solution --- .../csharp_for_fixes_1.cs | 0 .../csharp_project.csproj | 0 .../sample_project_fixes/dotnet_solution.sln | 31 +++++++++++++++++++ .../vbdotnet_for_fixes_1.vb | 0 .../vbdotnet_project.vbproj} | 0 5 files changed, 31 insertions(+) rename .automation/test/sample_project_fixes/{ => csharp_project}/csharp_for_fixes_1.cs (100%) rename .automation/test/sample_project_fixes/{ => csharp_project}/csharp_project.csproj (100%) create mode 100644 .automation/test/sample_project_fixes/dotnet_solution.sln rename .automation/test/sample_project_fixes/{ => vbdotnet_project}/vbdotnet_for_fixes_1.vb (100%) rename .automation/test/sample_project_fixes/{vb_projecty.vbproj => vbdotnet_project/vbdotnet_project.vbproj} (100%) diff --git a/.automation/test/sample_project_fixes/csharp_for_fixes_1.cs b/.automation/test/sample_project_fixes/csharp_project/csharp_for_fixes_1.cs similarity index 100% rename from .automation/test/sample_project_fixes/csharp_for_fixes_1.cs rename to .automation/test/sample_project_fixes/csharp_project/csharp_for_fixes_1.cs diff --git a/.automation/test/sample_project_fixes/csharp_project.csproj b/.automation/test/sample_project_fixes/csharp_project/csharp_project.csproj similarity index 100% rename from .automation/test/sample_project_fixes/csharp_project.csproj rename to .automation/test/sample_project_fixes/csharp_project/csharp_project.csproj diff --git a/.automation/test/sample_project_fixes/dotnet_solution.sln b/.automation/test/sample_project_fixes/dotnet_solution.sln new file mode 100644 index 00000000000..af0d713e994 --- /dev/null +++ b/.automation/test/sample_project_fixes/dotnet_solution.sln @@ -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 diff --git a/.automation/test/sample_project_fixes/vbdotnet_for_fixes_1.vb b/.automation/test/sample_project_fixes/vbdotnet_project/vbdotnet_for_fixes_1.vb similarity index 100% rename from .automation/test/sample_project_fixes/vbdotnet_for_fixes_1.vb rename to .automation/test/sample_project_fixes/vbdotnet_project/vbdotnet_for_fixes_1.vb diff --git a/.automation/test/sample_project_fixes/vb_projecty.vbproj b/.automation/test/sample_project_fixes/vbdotnet_project/vbdotnet_project.vbproj similarity index 100% rename from .automation/test/sample_project_fixes/vb_projecty.vbproj rename to .automation/test/sample_project_fixes/vbdotnet_project/vbdotnet_project.vbproj From 995e9df8be7e916d889535fb667d2a17532444e3 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sun, 31 Jul 2022 19:01:42 -0300 Subject: [PATCH 12/76] Upgrade dotnet version on linter dockers --- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index 47b37b17dd7..dd24edc6d7d 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index c076821a244..73d9c53f1fd 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" From 08e80ba23b5c60ed4c57f00367a916a96969dc80 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Mon, 1 Aug 2022 00:02:20 +0200 Subject: [PATCH 13/76] Really upgrade dotnet everywhere --- Dockerfile | 10 +++++----- flavors/ci_light/action.yml | 2 +- flavors/documentation/action.yml | 2 +- flavors/dotnet/Dockerfile | 8 ++++---- flavors/dotnet/action.yml | 2 +- flavors/go/action.yml | 2 +- flavors/java/action.yml | 2 +- flavors/javascript/action.yml | 2 +- flavors/php/action.yml | 2 +- flavors/python/action.yml | 2 +- flavors/ruby/action.yml | 2 +- flavors/rust/action.yml | 2 +- flavors/salesforce/action.yml | 2 +- flavors/security/Dockerfile | 2 +- flavors/security/action.yml | 2 +- flavors/swift/action.yml | 2 +- flavors/terraform/action.yml | 2 +- linters/repository_devskim/Dockerfile | 2 +- .../descriptors/repository.megalinter-descriptor.yml | 2 +- megalinter/descriptors/sql.megalinter-descriptor.yml | 2 +- 20 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee2b96fc1ef..c1e7bf4c0a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -494,10 +494,10 @@ RUN curl -L https://github.com/nxadm/rakudo-pkg/releases/download/v2020.10-02/ra ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH" # devskim installation -RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ - && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest - +# Next line commented because already managed by another linter +# RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ +# && chmod +x dotnet-install.sh \ +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI @@ -555,7 +555,7 @@ RUN ML_THIRD_PARTY_DIR="/third-party/misspell" \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/flavors/ci_light/action.yml b/flavors/ci_light/action.yml index 40329a282dc..3e3fed57c8f 100644 --- a/flavors/ci_light/action.yml +++ b/flavors/ci_light/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-ci_light:v6.2.0" + image: "docker://oxsecurity/megalinter-ci_light:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/documentation/action.yml b/flavors/documentation/action.yml index 3ddadb51c82..d58f964b135 100644 --- a/flavors/documentation/action.yml +++ b/flavors/documentation/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-documentation:v6.2.0" + image: "docker://oxsecurity/megalinter-documentation:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index 8ce17a5dd6c..abe6ccaf3c8 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -306,10 +306,10 @@ RUN ML_THIRD_PARTY_DIR="/third-party/misspell" \ # tsqllint installation -RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ - && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest - +# Next line commented because already managed by another linter +# RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ +# && chmod +x dotnet-install.sh \ +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/flavors/dotnet/action.yml b/flavors/dotnet/action.yml index cbba56fadbe..3a6fac77c84 100644 --- a/flavors/dotnet/action.yml +++ b/flavors/dotnet/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-dotnet:v6.2.0" + image: "docker://oxsecurity/megalinter-dotnet:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/go/action.yml b/flavors/go/action.yml index 3c43079f8f8..7437e3d7899 100644 --- a/flavors/go/action.yml +++ b/flavors/go/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-go:v6.2.0" + image: "docker://oxsecurity/megalinter-go:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/java/action.yml b/flavors/java/action.yml index b8d65f4a3ff..06ce9b02583 100644 --- a/flavors/java/action.yml +++ b/flavors/java/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-java:v6.2.0" + image: "docker://oxsecurity/megalinter-java:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/javascript/action.yml b/flavors/javascript/action.yml index 3f90fb2a991..9c77cb70fdd 100644 --- a/flavors/javascript/action.yml +++ b/flavors/javascript/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-javascript:v6.2.0" + image: "docker://oxsecurity/megalinter-javascript:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/php/action.yml b/flavors/php/action.yml index 20db6ac9d52..0ebb2bbc83c 100644 --- a/flavors/php/action.yml +++ b/flavors/php/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-php:v6.2.0" + image: "docker://oxsecurity/megalinter-php:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/python/action.yml b/flavors/python/action.yml index 43927a4c7e0..f88c5138454 100644 --- a/flavors/python/action.yml +++ b/flavors/python/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-python:v6.2.0" + image: "docker://oxsecurity/megalinter-python:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/ruby/action.yml b/flavors/ruby/action.yml index ae95251976a..3a9f1f4941b 100644 --- a/flavors/ruby/action.yml +++ b/flavors/ruby/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-ruby:v6.2.0" + image: "docker://oxsecurity/megalinter-ruby:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/rust/action.yml b/flavors/rust/action.yml index 7244ffd51d0..7c71cfccfb7 100644 --- a/flavors/rust/action.yml +++ b/flavors/rust/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-rust:v6.2.0" + image: "docker://oxsecurity/megalinter-rust:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/salesforce/action.yml b/flavors/salesforce/action.yml index 64a77a2d241..b85a8ab0767 100644 --- a/flavors/salesforce/action.yml +++ b/flavors/salesforce/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-salesforce:v6.2.0" + image: "docker://oxsecurity/megalinter-salesforce:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 9422d25ed8a..a6fc4c0c9a9 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -167,7 +167,7 @@ RUN ML_THIRD_PARTY_DIR="/third-party/kubeconform" \ # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/flavors/security/action.yml b/flavors/security/action.yml index 80593fbfe4d..3af08e57dc3 100644 --- a/flavors/security/action.yml +++ b/flavors/security/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-security:v6.2.0" + image: "docker://oxsecurity/megalinter-security:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/swift/action.yml b/flavors/swift/action.yml index 2ead102c406..5725d9202e1 100644 --- a/flavors/swift/action.yml +++ b/flavors/swift/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-swift:v6.2.0" + image: "docker://oxsecurity/megalinter-swift:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/flavors/terraform/action.yml b/flavors/terraform/action.yml index d8892920851..ea298ca6897 100644 --- a/flavors/terraform/action.yml +++ b/flavors/terraform/action.yml @@ -7,7 +7,7 @@ outputs: description: "0 if no source file has been updated, 1 if source files has been updated" runs: using: "docker" - image: "docker://oxsecurity/megalinter-terraform:v6.2.0" + image: "docker://oxsecurity/megalinter-terraform:v6" args: - "-v" - "/var/run/docker.sock:/var/run/docker.sock:rw" diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 30cfe84312e..81f67ee6372 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -109,7 +109,7 @@ ENV NODE_PATH="/node-deps/node_modules" # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 201131ba733..b8b8c803e6e 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -49,7 +49,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI ide: diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index cca2cf4cbc2..fb142fb2df3 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -81,7 +81,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global TSQLLint ide: From c96e1e94e7b581052903f013f6b8264950807255 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Mon, 1 Aug 2022 08:32:15 -0300 Subject: [PATCH 14/76] Revert "Upgrade dotnet version on linter dockers" This reverts commit 995e9df8be7e916d889535fb667d2a17532444e3. --- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index dd24edc6d7d..47b37b17dd7 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index 73d9c53f1fd..c076821a244 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" From f751c738c6317205be57c5cff987ac185e0628b7 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Wed, 3 Aug 2022 23:14:39 -0300 Subject: [PATCH 15/76] Testing some Dockerfile configs --- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 2 +- linters/sql_tsqllint/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index 47b37b17dd7..dd24edc6d7d 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 81f67ee6372..30cfe84312e 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -109,7 +109,7 @@ ENV NODE_PATH="/node-deps/node_modules" # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/linters/sql_tsqllint/Dockerfile b/linters/sql_tsqllint/Dockerfile index fb862bc2489..1786943fea0 100644 --- a/linters/sql_tsqllint/Dockerfile +++ b/linters/sql_tsqllint/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # tsqllint installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index c076821a244..73d9c53f1fd 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" From d84ae29c3d0fa7b46a33c6833d7b9d1732268b1b Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Thu, 4 Aug 2022 09:40:10 -0300 Subject: [PATCH 16/76] dotnet info --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 1 + megalinter/descriptors/repository.megalinter-descriptor.yml | 1 + megalinter/descriptors/sql.megalinter-descriptor.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index c08aa253fcb..9caef927a06 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,6 +31,7 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: dotnet --info cli_lint_mode: list_of_files cli_lint_extra_args: - "{{WORKSPACE}}" diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index b8b8c803e6e..b255256001a 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -18,6 +18,7 @@ linters: linter_rules_configuration_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command linter_rules_ignore_config_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command linter_image_url: https://github.com/microsoft/DevSkim/raw/main/media/devskim_logo.svg + pre_commands: dotnet --info cli_lint_mode: project cli_lint_extra_args: - analyze diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index fb142fb2df3..539f07fefe4 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -58,6 +58,7 @@ linters: linter_rules_url: https://github.com/tsqllint/tsqllint#rule-configuration linter_rules_configuration_url: https://github.com/tsqllint/tsqllint#rule-configuration linter_rules_inline_disable_url: https://github.com/tsqllint/tsqllint#disabling-rules-with-inline-comments + pre_commands: dotnet --info config_file_name: ".tsqllintrc" cli_lint_mode: list_of_files cli_config_arg_name: "--config" From 33c246b81d8ff2d7133072f6c271a06b6e05efdf Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Thu, 4 Aug 2022 23:02:00 -0300 Subject: [PATCH 17/76] Trying to figure out dotnet version running on each test case --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 +++- megalinter/descriptors/repository.megalinter-descriptor.yml | 4 +++- megalinter/descriptors/sql.megalinter-descriptor.yml | 4 +++- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 9caef927a06..456da02af9d 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,7 +31,9 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: dotnet --info + pre_commands: + - command: dotnet --info + cwd: "workspace" cli_lint_mode: list_of_files cli_lint_extra_args: - "{{WORKSPACE}}" diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index b255256001a..1920b221e69 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -18,7 +18,9 @@ linters: linter_rules_configuration_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command linter_rules_ignore_config_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command linter_image_url: https://github.com/microsoft/DevSkim/raw/main/media/devskim_logo.svg - pre_commands: dotnet --info + pre_commands: + - command: dotnet --info + cwd: "workspace" cli_lint_mode: project cli_lint_extra_args: - analyze diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index 539f07fefe4..ce3351d69c3 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -58,7 +58,9 @@ linters: linter_rules_url: https://github.com/tsqllint/tsqllint#rule-configuration linter_rules_configuration_url: https://github.com/tsqllint/tsqllint#rule-configuration linter_rules_inline_disable_url: https://github.com/tsqllint/tsqllint#disabling-rules-with-inline-comments - pre_commands: dotnet --info + pre_commands: + - command: dotnet --info + cwd: "workspace" config_file_name: ".tsqllintrc" cli_lint_mode: list_of_files cli_config_arg_name: "--config" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index e3af2c1b40b..5e04f936c75 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,6 +31,9 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: + - command: dotnet --info + cwd: "workspace" cli_lint_mode: list_of_files cli_lint_extra_args: - "{{WORKSPACE}}" From f6d53429c5f25c5e48aa07abd83b1d2b9b2e4d2a Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 5 Aug 2022 07:27:48 -0300 Subject: [PATCH 18/76] Checking root's workspace --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- megalinter/descriptors/repository.megalinter-descriptor.yml | 2 +- megalinter/descriptors/sql.megalinter-descriptor.yml | 2 +- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 456da02af9d..d5c78235dbd 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -33,7 +33,7 @@ linters: linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - command: dotnet --info - cwd: "workspace" + cwd: "root" cli_lint_mode: list_of_files cli_lint_extra_args: - "{{WORKSPACE}}" diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 1920b221e69..9cc4f8bfc42 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -20,7 +20,7 @@ linters: linter_image_url: https://github.com/microsoft/DevSkim/raw/main/media/devskim_logo.svg pre_commands: - command: dotnet --info - cwd: "workspace" + cwd: "root" cli_lint_mode: project cli_lint_extra_args: - analyze diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index ce3351d69c3..3bdf3544257 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -60,7 +60,7 @@ linters: linter_rules_inline_disable_url: https://github.com/tsqllint/tsqllint#disabling-rules-with-inline-comments pre_commands: - command: dotnet --info - cwd: "workspace" + cwd: "root" config_file_name: ".tsqllintrc" cli_lint_mode: list_of_files cli_config_arg_name: "--config" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 5e04f936c75..09586201c6a 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -33,7 +33,7 @@ linters: linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - command: dotnet --info - cwd: "workspace" + cwd: "root" cli_lint_mode: list_of_files cli_lint_extra_args: - "{{WORKSPACE}}" From 0bdb7233881b7864c29003bdf1be0c0927701353 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 5 Aug 2022 08:49:45 -0300 Subject: [PATCH 19/76] Checking for tool versions --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index d5c78235dbd..62474767075 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -34,6 +34,10 @@ linters: pre_commands: - command: dotnet --info cwd: "root" + - command: dotnet-format --version + cwd: "root" + - command: dotnet format --version + cwd: "root" cli_lint_mode: list_of_files cli_lint_extra_args: - "{{WORKSPACE}}" From be93ed6dfd8f109aa583320316301b952d42e3b6 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 12 Aug 2022 23:40:13 -0300 Subject: [PATCH 20/76] Removing dotnet-format install from Docker images --- Dockerfile | 7 ------- flavors/dotnet/Dockerfile | 7 ------- linters/csharp_dotnet_format/Dockerfile | 3 --- linters/vbdotnet_dotnet_format/Dockerfile | 3 --- 4 files changed, 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c3c2d0b389..04a5d242cf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -357,9 +357,6 @@ COPY --from=shfmt /bin/shfmt /usr/bin/ # clj-kondo installation COPY --from=clj-kondo /bin/clj-kondo /usr/bin/ -# dotnet-format installation -RUN /usr/share/dotnet/dotnet tool install -g dotnet-format - # dartanalyzer installation RUN wget --tries=50 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ && wget --tries=5 -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \ @@ -588,10 +585,6 @@ RUN mkdir -p /opt/kics/assets ENV KICS_QUERIES_PATH=/opt/kics/assets/queries KICS_LIBRARIES_PATH=/opt/kics/assets/libraries COPY --from=kics /app/bin/assets /opt/kics/assets/ -# dotnet-format installation -# Next line commented because already managed by another linter -# RUN /usr/share/dotnet/dotnet tool install -g dotnet-format - #OTHER__END ################################ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index abe6ccaf3c8..7ffadb3510d 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -238,9 +238,6 @@ RUN ML_THIRD_PARTY_DIR="/third-party/shellcheck" \ # shfmt installation COPY --from=shfmt /bin/shfmt /usr/bin/ -# dotnet-format installation -RUN /usr/share/dotnet/dotnet tool install -g dotnet-format - # hadolint installation COPY --from=hadolint /bin/hadolint /usr/bin/hadolint @@ -314,10 +311,6 @@ RUN ML_THIRD_PARTY_DIR="/third-party/misspell" \ # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint -# dotnet-format installation -# Next line commented because already managed by another linter -# RUN /usr/share/dotnet/dotnet tool install -g dotnet-format - #OTHER__END ################################ diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index dd24edc6d7d..1eb15fb93e8 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -111,9 +111,6 @@ RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -# dotnet-format installation -RUN /usr/share/dotnet/dotnet tool install -g dotnet-format - #OTHER__END ###################### diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index 73d9c53f1fd..77dd03eafa9 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -111,9 +111,6 @@ RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -# dotnet-format installation -RUN /usr/share/dotnet/dotnet tool install -g dotnet-format - #OTHER__END ###################### From fa059afb7a60025577f7094ff57c7991a0d718bf Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 12 Aug 2022 23:40:33 -0300 Subject: [PATCH 21/76] Updating linter versions and helps for dotnet-format --- .automation/generated/linter-helps.json | 35 ++++++++++++---------- .automation/generated/linter-versions.json | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.automation/generated/linter-helps.json b/.automation/generated/linter-helps.json index eb0ae81fcbe..beb67c98a95 100644 --- a/.automation/generated/linter-helps.json +++ b/.automation/generated/linter-helps.json @@ -1372,30 +1372,35 @@ " list Shows list of available checks [aliases: l]" ], "dotnet-format": [ - "dotnet-format", - " dotnet-format", + "Description:", + " Formats code to match editorconfig settings.", "", "Usage:", - " dotnet-format [options] []", + " dotnet format [] [command] [options]", "", "Arguments:", - " A path to a solution file, a project file, or a folder containing a solution or project file. If a path is not specified then the current directory is used. [default: ]", + " The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. [default: ]", "", "Options:", + " --diagnostics A space separated list of diagnostic ids to use as a filter when fixing code style or 3rd party issues.", + " [default: whichever ids are listed in the editorconfig file]", + " --severity The severity of diagnostics to fix. Allowed values are info, warn, and error.", " --no-restore Doesn't execute an implicit restore before formatting.", - " -f, --folder Whether to treat the `` argument as a simple folder of files.", - " -w, --fix-whitespace Run whitespace formatting. Run by default when not applying fixes.", - " -s, --fix-style Run code style analyzers and apply fixes.", - " -a, --fix-analyzers Run 3rd party analyzers and apply fixes.", - " --diagnostics A space separated list of diagnostic ids to use as a filter when fixing code style or 3rd party issues. [default: ]", - " --include A list of relative file or folder paths to include in formatting. All files are formatted if empty. [default: ]", - " --exclude A list of relative file or folder paths to exclude from formatting. [default: ]", - " --check Formats files without saving changes to disk. Terminates with a non-zero exit code if any files were formatted.", - " --report Accepts a file path, which if provided, will produce a json report in the given directory.", + " --verify-no-changes Verify no formatting changes would be performed. Terminates with a non-zero exit code if any files would have", + " been formatted.", + " --include A list of relative file or folder paths to include in formatting. All files are formatted if empty. [default:", + " all files in the solution or project]", + " --exclude A list of relative file or folder paths to exclude from formatting. [default: none]", + " --include-generated Format files generated by the SDK.", " -v, --verbosity Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]", " --binarylog Log all project or solution load information to a binary log file.", - " --version Show version information", - " -?, -h, --help Show help and usage information", + " --report Accepts a file path, which if provided, will produce a json report in the given directory.", + " -?, -h, --help Show command line help.", + "", + "Commands:", + " whitespace Run whitespace formatting. [default: ]", + " style Run code style analyzers and apply fixes. [default: ]", + " analyzers Run 3rd party analyzers and apply fixes. [default: ]", "" ], "dustilock": [ diff --git a/.automation/generated/linter-versions.json b/.automation/generated/linter-versions.json index 2b16f28d418..de736f2a9a4 100644 --- a/.automation/generated/linter-versions.json +++ b/.automation/generated/linter-versions.json @@ -19,7 +19,7 @@ "devskim": "0.6.9", "dockerfilelint": "1.8.0", "dotenv-linter": "3.2.0", - "dotnet-format": "000", + "dotnet-format": "6.3.322007", "dustilock": "0.0.0", "editorconfig-checker": "2.4.0", "eslint": "8.21.0", From dea1008f8f8959aae51908509956f2e4c13f2f55 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 12 Aug 2022 23:41:08 -0300 Subject: [PATCH 22/76] Reverting pre_coomands and configuring new dotnet format params --- .../descriptors/csharp.megalinter-descriptor.yml | 15 +++------------ .../repository.megalinter-descriptor.yml | 3 --- .../descriptors/sql.megalinter-descriptor.yml | 3 --- .../vbdotnet.megalinter-descriptor.yml | 11 +++-------- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 62474767075..ea38ab030ff 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,14 +31,8 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: - - command: dotnet --info - cwd: "root" - - command: dotnet-format --version - cwd: "root" - - command: dotnet format --version - cwd: "root" cli_lint_mode: list_of_files + cli_executable: dotnet cli_lint_extra_args: - "{{WORKSPACE}}" - "--verify-no-changes" @@ -50,8 +44,5 @@ linters: - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet-format --verify-no-changes --exclude / --include myfile.cs myfile2.cs" - - "dotnet-format --exclude / --include myfile.cs myfile2.cs" # Fix - install: - dockerfile: - - RUN /usr/share/dotnet/dotnet tool install -g dotnet-format + - "dotnet format --verify-no-changes --exclude / --include myfile.cs myfile2.cs" + - "dotnet format --exclude / --include myfile.cs myfile2.cs" # Fix diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 1bff4861435..1249a876920 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -55,9 +55,6 @@ linters: linter_rules_configuration_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command linter_rules_ignore_config_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command linter_image_url: https://github.com/microsoft/DevSkim/raw/main/media/devskim_logo.svg - pre_commands: - - command: dotnet --info - cwd: "root" cli_lint_mode: project cli_lint_extra_args: - analyze diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index 3bdf3544257..fb142fb2df3 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -58,9 +58,6 @@ linters: linter_rules_url: https://github.com/tsqllint/tsqllint#rule-configuration linter_rules_configuration_url: https://github.com/tsqllint/tsqllint#rule-configuration linter_rules_inline_disable_url: https://github.com/tsqllint/tsqllint#disabling-rules-with-inline-comments - pre_commands: - - command: dotnet --info - cwd: "root" config_file_name: ".tsqllintrc" cli_lint_mode: list_of_files cli_config_arg_name: "--config" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 09586201c6a..3f8d0d5773e 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,10 +31,8 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: - - command: dotnet --info - cwd: "root" cli_lint_mode: list_of_files + cli_executable: dotnet cli_lint_extra_args: - "{{WORKSPACE}}" - "--verify-no-changes" @@ -46,8 +44,5 @@ linters: - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet-format --verify-no-changes --exclude / --include myfile.vb myfile2.vb" - - "dotnet-format --exclude / --include myfile.vb myfile2.vb" - install: - dockerfile: - - RUN /usr/share/dotnet/dotnet tool install -g dotnet-format + - "dotnet format --verify-no-changes --exclude / --include myfile.vb myfile2.vb" + - "dotnet format --exclude / --include myfile.vb myfile2.vb" From c27e374d190e80ee0f80bc3b1ce360ebe02a7bbd Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sat, 13 Aug 2022 08:28:58 -0300 Subject: [PATCH 23/76] Forgot the "format" argument --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 1 + megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index ea38ab030ff..874dded9b02 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -34,6 +34,7 @@ linters: cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: + - "format" - "{{WORKSPACE}}" - "--verify-no-changes" - "--exclude" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 3f8d0d5773e..0d66cbb1b1c 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -34,6 +34,7 @@ linters: cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: + - "format" - "{{WORKSPACE}}" - "--verify-no-changes" - "--exclude" From ecd5cf0464bd113078960e3d9cf5ea0b29771050 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sat, 13 Aug 2022 09:54:02 -0300 Subject: [PATCH 24/76] Updating test reports --- .../csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt | 7 ++----- .../csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt | 4 +--- .../vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt | 11 ++++------- .../reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt | 6 ++---- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt index f4b4bc59757..6643a0f9d37 100644 --- a/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt @@ -1,10 +1,7 @@ -Results of dotnet-format linter (version 4.1.131201) +Results of dotnet-format linter (version 6.3.322007) 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. + .automation\test\csharp\csharp_bad_01.cs(5,18): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s'. [.automation\test\csharp\csharp_project.csproj] diff --git a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt index 12bca8f7579..7a4db7a1fb3 100644 --- a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt @@ -1,8 +1,6 @@ -Results of dotnet-format linter (version 4.1.131201) +Results of dotnet-format linter (version 6.3.322007) 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. diff --git a/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt index 87e3dfcc2f0..8b4e7bf70ac 100644 --- a/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt @@ -1,12 +1,9 @@ -Results of dotnet-format linter (version 4.1.131201) +Results of dotnet-format linter (version 6.3.322007) 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. + vbdotnet\vbdotnet_bad_1.vb(3,20): error WHITESPACE: Fix whitespace formatting. Replace 4 characters with '\r\n\s\s\s\s'. [.automation\test\vbdotnet\vb_projecty.vbproj] + vbdotnet\vbdotnet_bad_1.vb(4,20): error WHITESPACE: Fix whitespace formatting. Delete 2 characters. [.automation\test\vbdotnet\vb_projecty.vbproj] + vbdotnet\vbdotnet_bad_1.vb(4,23): error WHITESPACE: Fix whitespace formatting. Replace 7 characters with '\r\n\s\s\s\s\s\s\s\s'. [.automation\test\vbdotnet\vb_projecty.vbproj] diff --git a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt index 63a94e4b7b0..5a77a006107 100644 --- a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt @@ -1,8 +1,6 @@ -Results of dotnet-format linter (version 4.1.131201) +Results of dotnet-format linter (version 6.3.322007) 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/vbdotnet_good_1.vb From c01d9462d9fa1aad3d6ad5dae3ac0e0cd56b8135 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sat, 13 Aug 2022 11:31:22 -0300 Subject: [PATCH 25/76] Fixed ERROR paths --- .../test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt | 2 +- .../test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt index 6643a0f9d37..b9d54d2b484 100644 --- a/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt @@ -3,5 +3,5 @@ See documentation on https://megalinter.github.io/descriptors/csharp_dotnet_form ----------------------------------------------- [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 '\r\n\s\s\s\s'. [.automation\test\csharp\csharp_project.csproj] + .automation/test/csharp/csharp_bad_01.cs(5,18): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s'. [.automation/test/csharp/csharp_project.csproj] diff --git a/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt index 8b4e7bf70ac..62eb048be61 100644 --- a/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt @@ -3,7 +3,7 @@ See documentation on https://megalinter.github.io/descriptors/vbdotnet_dotnet_fo ----------------------------------------------- [ERROR] .automation/test/vbdotnet/vbdotnet_bad_1.vb - vbdotnet\vbdotnet_bad_1.vb(3,20): error WHITESPACE: Fix whitespace formatting. Replace 4 characters with '\r\n\s\s\s\s'. [.automation\test\vbdotnet\vb_projecty.vbproj] - vbdotnet\vbdotnet_bad_1.vb(4,20): error WHITESPACE: Fix whitespace formatting. Delete 2 characters. [.automation\test\vbdotnet\vb_projecty.vbproj] - vbdotnet\vbdotnet_bad_1.vb(4,23): error WHITESPACE: Fix whitespace formatting. Replace 7 characters with '\r\n\s\s\s\s\s\s\s\s'. [.automation\test\vbdotnet\vb_projecty.vbproj] + .automation/test/vbdotnet/vbdotnet_bad_1.vb(3,20): error WHITESPACE: Fix whitespace formatting. Replace 4 characters with '\r\n\s\s\s\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(4,23): error WHITESPACE: Fix whitespace formatting. Replace 7 characters with '\r\n\s\s\s\s\s\s\s\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] From e20508e6c1f9adfdffbda4b41184d4fa3d1a1291 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Thu, 24 Nov 2022 08:11:37 +0100 Subject: [PATCH 26/76] Undowngrade DevSkim version --- Dockerfile | 5 +---- flavors/dotnet/Dockerfile | 3 --- flavors/security/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 4 ++-- megalinter/descriptors/repository.megalinter-descriptor.yml | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffa89678547..a49053e4ef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -411,9 +411,6 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ # clj-kondo installation # Managed with COPY --from=clj-kondo /bin/clj-kondo /usr/bin/ -# dotnet-format installation - && /usr/share/dotnet/dotnet tool install -g dotnet-format \ - # dartanalyzer installation && wget --tries=50 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ && wget --tries=5 -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \ @@ -550,7 +547,7 @@ ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$ # && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version 0.6.9 \ +RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest \ # dustilock installation && ML_THIRD_PARTY_DIR=/download/dustilock && \ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index bca474c0d05..52f48648eaa 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -288,9 +288,6 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ && chmod +x "${BICEP_EXE}" \ && mv "${BICEP_EXE}" "${BICEP_DIR}" \ -# dotnet-format installation - && /usr/share/dotnet/dotnet tool install -g dotnet-format \ - # hadolint installation # Managed with COPY --from=hadolint /bin/hadolint /usr/bin/hadolint diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 8d7e1c5d8fb..32efb8a4d91 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -213,7 +213,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version 0.6.9 \ +RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest \ # dustilock installation && ML_THIRD_PARTY_DIR=/download/dustilock && \ diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 3b04cc01ece..d16070229d7 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -132,10 +132,10 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version 0.6.9 +RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest #OTHER__END diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 19f72d6f9b9..755b0538dd2 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -93,7 +93,7 @@ linters: && chmod +x dotnet-install.sh \ && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version 0.6.9 + - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest ide: vscode: - name: VSCode DevSkim From 3d7d0fe8a9f7778e203e52c2977f8e1d4f4031b3 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Thu, 24 Nov 2022 08:13:06 +0100 Subject: [PATCH 27/76] changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 043cb2a1af4..93be923c605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-linter.yml file, or with `oxsecurity/megalinter:beta` docker image +- Upgrade to dotnet 6.0 + `list_of_files` for dotnet-format CLI lint mode to improve performances (requires `.csproj` or `.vbproj` in the repo) + - Linter versions upgrades @@ -64,8 +66,6 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Allow cspell to also analyze file names (new variable SPELL_CSPELL_ANALYZE_FILE_NAMES) ([#2009](https://github.com/oxsecurity/megalinter/issues/2009)) - Fix bicep version regex -- Upgrade to dotnet 6.0 + `list_of_files` for dotnet-format CLI lint mode to improve performances (requires `.csproj` or `.vbproj` in the repo) - - Linter versions upgrades - [actionlint](https://rhysd.github.io/actionlint/) from 1.6.21 to **1.6.22** - [bicep_linter](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/linter) from 0.11.1 to to **0.12.1** From fb4039156e086deff0dfd61547928a06d750865a Mon Sep 17 00:00:00 2001 From: nvuillam Date: Thu, 24 Nov 2022 18:32:52 +0100 Subject: [PATCH 28/76] Remove version from DevSkim install line --- Dockerfile | 2 +- flavors/security/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 2 +- megalinter/descriptors/repository.megalinter-descriptor.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a49053e4ef7..17ef4e4273b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -547,7 +547,7 @@ ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$ # && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest \ +RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ # dustilock installation && ML_THIRD_PARTY_DIR=/download/dustilock && \ diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 32efb8a4d91..3f2a8387951 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -213,7 +213,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest \ +RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ # dustilock installation && ML_THIRD_PARTY_DIR=/download/dustilock && \ diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index d16070229d7..69033ea8693 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -135,7 +135,7 @@ RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" -RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest +RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI #OTHER__END diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 755b0538dd2..261de2a2213 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -93,7 +93,7 @@ linters: && chmod +x dotnet-install.sh \ && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI --version latest + - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI ide: vscode: - name: VSCode DevSkim From 960d165fd3f02d9b598266f30408835e34c8231c Mon Sep 17 00:00:00 2001 From: nvuillam Date: Thu, 24 Nov 2022 19:58:47 +0100 Subject: [PATCH 29/76] Update TSQLLint version --- Dockerfile | 2 +- flavors/dotnet/Dockerfile | 2 +- megalinter/descriptors/sql.megalinter-descriptor.yml | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17ef4e4273b..1d5b74f9710 100644 --- a/Dockerfile +++ b/Dockerfile @@ -606,7 +606,7 @@ RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ # && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - && dotnet tool install --global --version 1.14.5 TSQLLint \ + && dotnet tool install --global TSQLLint \ # tflint installation # Managed with COPY --from=tflint /usr/local/bin/tflint /usr/bin/ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index 52f48648eaa..e1673cc41a1 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -355,7 +355,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ # && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - && dotnet tool install --global --version 1.14.5 TSQLLint + && dotnet tool install --global TSQLLint #OTHER__END diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index ec1bbd16302..7329efc732f 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -68,7 +68,6 @@ linters: examples: - "tsqllint myfile.sql" - "tsqllint myfile.sql myfile2.sql" - downgraded_version: true install: apk: - icu-libs @@ -85,7 +84,7 @@ linters: && chmod +x dotnet-install.sh \ && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - - RUN dotnet tool install --global --version 1.14.5 TSQLLint + - RUN dotnet tool install --global TSQLLint ide: vscode: - name: TSQL Lint From 2d9d5660d85a6fb376568b98c8c21d553f8cf907 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Thu, 24 Nov 2022 20:03:34 +0100 Subject: [PATCH 30/76] fix dotnet format call --- megalinter/linters/DotnetFormatLinter.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index e32bbf133a7..f4dedaa2e5f 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -23,10 +23,11 @@ def build_lint_command(self, file=None): ] else: + return super().build_lint_command(None) # cli_lint_mode = list_of_files or project - dotnet_format_command = " ".join(super().build_lint_command(None)) - commands = [ - dotnet_format_command + " | tee /dev/tty2 2>&1", - 'exit "${PIPESTATUS[0]}"', - ] - return " && ".join(commands) + # dotnet_format_command = " ".join(super().build_lint_command(None)) + # commands = [ + # dotnet_format_command + " | tee /dev/tty2 2>&1", + # 'exit "${PIPESTATUS[0]}"', + #] + # return " && ".join(commands) From 92f57bc07d33e5da603cd8e18fd5ebf14e954c50 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 25 Nov 2022 22:30:06 -0300 Subject: [PATCH 31/76] Using relative paths for worksapces --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 874dded9b02..0e5308452f6 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -35,7 +35,7 @@ linters: cli_executable: dotnet cli_lint_extra_args: - "format" - - "{{WORKSPACE}}" + - ".{{WORKSPACE}}" - "--verify-no-changes" - "--exclude" - "/" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 0d66cbb1b1c..ce0da097343 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -35,7 +35,7 @@ linters: cli_executable: dotnet cli_lint_extra_args: - "format" - - "{{WORKSPACE}}" + - ".{{WORKSPACE}}" - "--verify-no-changes" - "--exclude" - "/" From 4c26868831d3d0495dd9c06be87428fd65c46836 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Fri, 25 Nov 2022 23:32:02 -0300 Subject: [PATCH 32/76] Detailed logging for debug --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 ++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 0e5308452f6..38e284315ad 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -37,6 +37,8 @@ linters: - "format" - ".{{WORKSPACE}}" - "--verify-no-changes" + - "--verbosity" + - "detailed" - "--exclude" - "/" - "--include" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index ce0da097343..a859f539284 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -37,6 +37,8 @@ linters: - "format" - ".{{WORKSPACE}}" - "--verify-no-changes" + - "--verbosity" + - "detailed" - "--exclude" - "/" - "--include" From ae801223a23f6c9d827f15e9a7093f1ac04705f1 Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sat, 26 Nov 2022 07:36:04 -0300 Subject: [PATCH 33/76] Revert "Using relative paths for worksapces" This reverts commit 92f57bc07d33e5da603cd8e18fd5ebf14e954c50. --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 38e284315ad..836e334d70b 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -35,7 +35,7 @@ linters: cli_executable: dotnet cli_lint_extra_args: - "format" - - ".{{WORKSPACE}}" + - "{{WORKSPACE}}" - "--verify-no-changes" - "--verbosity" - "detailed" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index a859f539284..25a052864ee 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -35,7 +35,7 @@ linters: cli_executable: dotnet cli_lint_extra_args: - "format" - - ".{{WORKSPACE}}" + - "{{WORKSPACE}}" - "--verify-no-changes" - "--verbosity" - "detailed" From a38264f9657fa94c4abcbac76d51b3fbdde7f5ef Mon Sep 17 00:00:00 2001 From: Alexandre Melotti Date: Sat, 26 Nov 2022 08:28:04 -0300 Subject: [PATCH 34/76] Disabling list_of_files mode. --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 8 ++++---- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 836e334d70b..c3f8e2c20cc 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,7 +31,7 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - cli_lint_mode: list_of_files + #cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: - "format" @@ -39,9 +39,9 @@ linters: - "--verify-no-changes" - "--verbosity" - "detailed" - - "--exclude" - - "/" - - "--include" + #- "--exclude" + #- "/" + #- "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround for DotnetFormatLinter class behavior cli_lint_fix_remove_args: - "--verify-no-changes" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 25a052864ee..d282c7fdb37 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,7 +31,7 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - cli_lint_mode: list_of_files + #cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: - "format" @@ -39,9 +39,9 @@ linters: - "--verify-no-changes" - "--verbosity" - "detailed" - - "--exclude" - - "/" - - "--include" + #- "--exclude" + #- "/" + #- "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround to allow fix cli_lint_fix_remove_args: - "--verify-no-changes" From 1210aa7a42cc41fbc283895409976117620f6a23 Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 26 Nov 2022 19:22:47 -0300 Subject: [PATCH 35/76] Reverting back to list_of_files --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 ++-- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index c3f8e2c20cc..1136728f93c 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,7 +31,7 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - #cli_lint_mode: list_of_files + cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: - "format" @@ -41,7 +41,7 @@ linters: - "detailed" #- "--exclude" #- "/" - #- "--include" + - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround for DotnetFormatLinter class behavior cli_lint_fix_remove_args: - "--verify-no-changes" diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index d282c7fdb37..173b1a67827 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,7 +31,7 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - #cli_lint_mode: list_of_files + cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: - "format" @@ -41,7 +41,7 @@ linters: - "detailed" #- "--exclude" #- "/" - #- "--include" + - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround to allow fix cli_lint_fix_remove_args: - "--verify-no-changes" From 45402ecf77fe774515ce05a4c8cdf7a4288d4c9d Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 26 Nov 2022 21:40:56 -0300 Subject: [PATCH 36/76] Echoing linting command --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 3 +++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 1136728f93c..dec4d0613be 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,6 +31,9 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: + - command: set -x + cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 173b1a67827..2499e3c60d8 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,6 +31,9 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: + - command: set -x + cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: From d25dced07b1f13e36991f14cb839987b45a959c5 Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 26 Nov 2022 22:53:53 -0300 Subject: [PATCH 37/76] Checking workspace path --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 6 +++--- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index dec4d0613be..d136fa20135 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,7 +32,9 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: set -x + - command: ls + cwd: "/" + - command: dotnet format --version cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet @@ -42,8 +44,6 @@ linters: - "--verify-no-changes" - "--verbosity" - "detailed" - #- "--exclude" - #- "/" - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround for DotnetFormatLinter class behavior cli_lint_fix_remove_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 2499e3c60d8..70ebf1b1a13 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,8 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: set -x + - command: ls cwd: "root" + - command: dotnet format --version + cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: @@ -42,8 +44,6 @@ linters: - "--verify-no-changes" - "--verbosity" - "detailed" - #- "--exclude" - #- "/" - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround to allow fix cli_lint_fix_remove_args: From 51288ccfcc6cd9fb51d3c4be214fc7beff43e32e Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 26 Nov 2022 23:34:58 -0300 Subject: [PATCH 38/76] Fixing descriptor parsing --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 8 ++++---- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index d136fa20135..3cb89de7713 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,10 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: ls - cwd: "/" - - command: dotnet format --version - cwd: "root" + - command: ls + cwd: "/" + - command: dotnet format --version + cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 70ebf1b1a13..4085715e009 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,7 +32,7 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: ls + - command: ls cwd: "root" - command: dotnet format --version cwd: "root" From 8f1362d10a4d24b8460ab37a47fc2f9f02915efd Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 26 Nov 2022 23:35:44 -0300 Subject: [PATCH 39/76] Fix parse --- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 4085715e009..12486750b03 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,9 +32,9 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: ls - cwd: "root" - - command: dotnet format --version + - command: ls + cwd: "root" + - command: dotnet format --version cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet From d23c648b27260b43a33c74ad84493b1bae9fd258 Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 10:28:30 -0300 Subject: [PATCH 40/76] Trying to figure out why --include is failing --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 8 ++++++-- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 3cb89de7713..d9041cada3f 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,9 +32,13 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: ls + - command: set -x cwd: "/" - - command: dotnet format --version + - command: ls + cwd: "/" + - command: ls /tmp/lint/.automation/test/csharp + cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 12486750b03..5e72114babe 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,9 +32,13 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: ls + - command: set -x + cwd: "/" + - command: ls cwd: "root" - - command: dotnet format --version + - command: ls /tmp/lint/.automation/test/vbdotnet + cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d cwd: "root" cli_lint_mode: list_of_files cli_executable: dotnet From 7f136bae9820bace9e1b5ccfb473963a1ab62781 Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 11:20:14 -0300 Subject: [PATCH 41/76] Testing the exact computed command manually --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 8 ++------ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index d9041cada3f..15fc67b0a4c 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,14 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: set -x - cwd: "/" - - command: ls - cwd: "/" - command: ls /tmp/lint/.automation/test/csharp cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d - cwd: "root" + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs /tmp/lint/.automation/test/csharp/csharp_bad_02.cs + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 5e72114babe..d89869ce29c 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,14 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: set -x - cwd: "/" - - command: ls - cwd: "root" - command: ls /tmp/lint/.automation/test/vbdotnet cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d - cwd: "root" + - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_1.vb + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: From a6fa5d62e121e3e6d1214b1a066d6c4fd423ec1b Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 12:22:00 -0300 Subject: [PATCH 42/76] Testing relative paths --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 15fc67b0a4c..55f6333d840 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -34,7 +34,7 @@ linters: pre_commands: - command: ls /tmp/lint/.automation/test/csharp cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs /tmp/lint/.automation/test/csharp/csharp_bad_02.cs + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include ./tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index d89869ce29c..e31545b4f4a 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -34,7 +34,7 @@ linters: pre_commands: - command: ls /tmp/lint/.automation/test/vbdotnet cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_1.vb + - command: dotnet format ./tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_1.vb cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet From a754088c8392cda2aa82663b603004c0263e0a28 Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 13:29:45 -0300 Subject: [PATCH 43/76] Checking file contnt before testing linter --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 +++- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 55f6333d840..79cf2f6ed05 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -34,7 +34,9 @@ linters: pre_commands: - command: ls /tmp/lint/.automation/test/csharp cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include ./tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + - command: echo "$( Date: Sun, 27 Nov 2022 14:53:25 -0300 Subject: [PATCH 44/76] Checking editorconfig contents --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 6 ++++++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 79cf2f6ed05..4c4da679e30 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -36,6 +36,12 @@ linters: cwd: "/" - command: echo "$( Date: Sun, 27 Nov 2022 16:12:02 -0300 Subject: [PATCH 45/76] Adding editorconfigs to validate whitespaces. Also reverting all changes to descriptors. --- .automation/test/csharp/.editorconfig | 67 +++++++++++++++++++ .automation/test/vbdotnet/.editorconfig | 67 +++++++++++++++++++ .../csharp.megalinter-descriptor.yml | 19 +----- .../vbdotnet.megalinter-descriptor.yml | 11 +-- 4 files changed, 138 insertions(+), 26 deletions(-) create mode 100644 .automation/test/csharp/.editorconfig create mode 100644 .automation/test/vbdotnet/.editorconfig diff --git a/.automation/test/csharp/.editorconfig b/.automation/test/csharp/.editorconfig new file mode 100644 index 00000000000..3e4ba22f691 --- /dev/null +++ b/.automation/test/csharp/.editorconfig @@ -0,0 +1,67 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +insert_final_newline = true + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true:warning +dotnet_style_object_initializer = true:warning +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = false +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning +dotnet_style_prefer_simplified_boolean_expressions = true:warning +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true:warning + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = false:warning +dotnet_style_allow_statement_immediately_after_block_experimental = false:warning diff --git a/.automation/test/vbdotnet/.editorconfig b/.automation/test/vbdotnet/.editorconfig new file mode 100644 index 00000000000..3e4ba22f691 --- /dev/null +++ b/.automation/test/vbdotnet/.editorconfig @@ -0,0 +1,67 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +insert_final_newline = true + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true:warning +dotnet_style_object_initializer = true:warning +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = false +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning +dotnet_style_prefer_simplified_boolean_expressions = true:warning +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true:warning + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = false:warning +dotnet_style_allow_statement_immediately_after_block_experimental = false:warning diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 4c4da679e30..c8cf66a75ba 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,32 +31,17 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: - - command: ls /tmp/lint/.automation/test/csharp - cwd: "/" - - command: echo "$( Date: Sun, 27 Nov 2022 17:00:46 -0300 Subject: [PATCH 46/76] Re-enabling detailed logging --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 ++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index c8cf66a75ba..e08ea1d1f3a 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -37,6 +37,8 @@ linters: - "format" - "{{WORKSPACE}}" - "--verify-no-changes" + - "-v" + - "d" - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround for DotnetFormatLinter class behavior cli_lint_fix_remove_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 2158c276b7b..d5cd63f1a53 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -37,6 +37,8 @@ linters: - "format" - "{{WORKSPACE}}" - "--verify-no-changes" + - "-v" + - "d" - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround to allow fix cli_lint_fix_remove_args: From f457abc02a3ed41e56217b29492a1bfb28a7ae6a Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 19:23:00 -0300 Subject: [PATCH 47/76] Adding style error to csharp_bad_02.cs. --- .automation/test/csharp/csharp_bad_02.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/.automation/test/csharp/csharp_bad_02.cs b/.automation/test/csharp/csharp_bad_02.cs index 212df2b95bb..ee40f8b0470 100644 --- a/.automation/test/csharp/csharp_bad_02.cs +++ b/.automation/test/csharp/csharp_bad_02.cs @@ -7,6 +7,7 @@ class Program static void Main (string[] args) { Console.WriteLine ("Hello World!"); + var value = 3 * 4 + 5; } } } From 0082851533d30f80d49110283a90017f65b7bc68 Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 19:23:59 -0300 Subject: [PATCH 48/76] Testing whitespace formatting for vb only --- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index d5cd63f1a53..1f3653e2b81 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -35,6 +35,7 @@ linters: cli_executable: dotnet cli_lint_extra_args: - "format" + - "whitespace" - "{{WORKSPACE}}" - "--verify-no-changes" - "-v" From 4a85cdb5cd703b1af0ac1fde122eb471615def0f Mon Sep 17 00:00:00 2001 From: Lex Date: Sun, 27 Nov 2022 20:37:17 -0300 Subject: [PATCH 49/76] I don't know anymore --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 6 ++++++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index e08ea1d1f3a..f27455fe209 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,6 +31,12 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + cwd: "/" + pre_commands: + - command: dotnet format /tmp/lint/.automation/test/csharp/csharp_project.csproj --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 1f3653e2b81..478f5c3dd89 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,10 +32,8 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files - cli_executable: dotnet cli_lint_extra_args: - "format" - - "whitespace" - "{{WORKSPACE}}" - "--verify-no-changes" - "-v" From 7d881e65e68b9768516ef15de80a943b2be4eb52 Mon Sep 17 00:00:00 2001 From: Lex Date: Mon, 28 Nov 2022 07:18:42 -0300 Subject: [PATCH 50/76] Fixed VB descriptor --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 ++-- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index f27455fe209..319c6ac8ad5 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,10 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs cwd: "/" pre_commands: - - command: dotnet format /tmp/lint/.automation/test/csharp/csharp_project.csproj --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 478f5c3dd89..d5cd63f1a53 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,6 +32,7 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png cli_lint_mode: list_of_files + cli_executable: dotnet cli_lint_extra_args: - "format" - "{{WORKSPACE}}" From 86fe8ed93757cfe9cf5b73d179007533ed57b62d Mon Sep 17 00:00:00 2001 From: Lex Date: Tue, 29 Nov 2022 18:20:36 -0300 Subject: [PATCH 51/76] A few mroe tests with editorconfigs --- .automation/test/csharp/.editorconfig | 2 +- .automation/test/vbdotnet/.editorconfig | 6 +++--- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 ++-- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 6 ++++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.automation/test/csharp/.editorconfig b/.automation/test/csharp/.editorconfig index 3e4ba22f691..0c48b2017a5 100644 --- a/.automation/test/csharp/.editorconfig +++ b/.automation/test/csharp/.editorconfig @@ -8,7 +8,7 @@ root = true # Indentation and spacing indent_size = 4 -indent_style = space +indent_style = tab tab_width = 4 # New line preferences diff --git a/.automation/test/vbdotnet/.editorconfig b/.automation/test/vbdotnet/.editorconfig index 3e4ba22f691..3c51e38c6cc 100644 --- a/.automation/test/vbdotnet/.editorconfig +++ b/.automation/test/vbdotnet/.editorconfig @@ -1,14 +1,14 @@ # Remove the line below if you want to inherit .editorconfig settings from higher directories root = true -# C# files -[*.cs] +# VB files +[*.vb] #### Core EditorConfig Options #### # Indentation and spacing indent_size = 4 -indent_style = space +indent_style = tab tab_width = 4 # New line preferences diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 319c6ac8ad5..eac5f14abc2 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,10 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs cwd: "/" pre_commands: - - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs + - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index d5cd63f1a53..2e2cbf4c45a 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -31,6 +31,12 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: + - command: dotnet format whitespace /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs + cwd: "/" + pre_commands: + - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: From 677f1ef3227cb8994896ad5ef17420a912eba6e0 Mon Sep 17 00:00:00 2001 From: Lex Date: Tue, 29 Nov 2022 19:19:03 -0300 Subject: [PATCH 52/76] Fixed pre-command syntax --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 1 - megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index eac5f14abc2..621be91f111 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -34,7 +34,6 @@ linters: pre_commands: - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs cwd: "/" - pre_commands: - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs cwd: "/" cli_lint_mode: list_of_files diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 2e2cbf4c45a..eb460b5c8f2 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -34,8 +34,7 @@ linters: pre_commands: - command: dotnet format whitespace /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs cwd: "/" - pre_commands: - - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs + - command: dotnet format style /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet From 02df457922dd9e7ea5213d2ddf92a69a4d1a8b3d Mon Sep 17 00:00:00 2001 From: Lex Date: Tue, 29 Nov 2022 21:40:18 -0300 Subject: [PATCH 53/76] Testing lint without --include parameter --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 6 ++++++ megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 621be91f111..e436cacdc3a 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -36,6 +36,12 @@ linters: cwd: "/" - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d + cwd: "/" + - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d + cwd: "/" + - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index eb460b5c8f2..0c8e1faab4f 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -36,6 +36,12 @@ linters: cwd: "/" - command: dotnet format style /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d + cwd: "/" + - command: dotnet format style /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d + cwd: "/" + - command: dotnet format whitespace /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: From 1e939760f2075acc4cc6c421670de7701e6fbfab Mon Sep 17 00:00:00 2001 From: Lex Date: Tue, 29 Nov 2022 23:49:03 -0300 Subject: [PATCH 54/76] Trying several path styles --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 8 +------- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index e436cacdc3a..f06ba66ae21 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,16 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs - cwd: "/" - - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs /tmp/lint/.automation/test/csharp/csharp_good_01.cs ./tmp/lint/.automation/test/csharp/csharp_good_02.cs + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include csharp_bad_01.cs '/tmp/lint/.automation/test/csharp/csharp_bad_02.cs' 'tmp/lint/.automation/test/csharp/csharp_good_01.cs' './tmp/lint/.automation/test/csharp/csharp_good_02.cs' cwd: "/" - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d cwd: "/" - - command: dotnet format style /tmp/lint/.automation/test/csharp --verify-no-changes -v d - cwd: "/" - - command: dotnet format whitespace /tmp/lint/.automation/test/csharp --verify-no-changes -v d - cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 0c8e1faab4f..b4689844991 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -32,16 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: dotnet format whitespace /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs - cwd: "/" - - command: dotnet format style /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_bad_02.cs /tmp/lint/.automation/test/vbdotnet/vbdotnet_good_01.cs ./tmp/lint/.automation/test/vbdotnet/vbdotnet_good_02.cs + - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /vbdotnet_bad_01.cs '/vbdotnet_bad_02.cs' './vbdotnet_good_01.cs' '\tmp\lint\.automation\test\vbdotnet\vbdotnet_good_02.cs' cwd: "/" - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d cwd: "/" - - command: dotnet format style /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d - cwd: "/" - - command: dotnet format whitespace /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d - cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: From 6adfc7a685555d2226b1784f8276406377d4e529 Mon Sep 17 00:00:00 2001 From: Lex Date: Wed, 30 Nov 2022 08:11:29 -0300 Subject: [PATCH 55/76] Testing some different paths --- .automation/test/csharp/csharp_bad_03.cs | 13 +++++++++++++ .automation/test/csharp/csharp_bad_04.cs | 13 +++++++++++++ .../descriptors/csharp.megalinter-descriptor.yml | 8 +++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .automation/test/csharp/csharp_bad_03.cs create mode 100644 .automation/test/csharp/csharp_bad_04.cs diff --git a/.automation/test/csharp/csharp_bad_03.cs b/.automation/test/csharp/csharp_bad_03.cs new file mode 100644 index 00000000000..ee40f8b0470 --- /dev/null +++ b/.automation/test/csharp/csharp_bad_03.cs @@ -0,0 +1,13 @@ +using System; + +namespace HelloWorld +{ + class Program + { + static void Main (string[] args) + { + Console.WriteLine ("Hello World!"); + var value = 3 * 4 + 5; + } + } +} diff --git a/.automation/test/csharp/csharp_bad_04.cs b/.automation/test/csharp/csharp_bad_04.cs new file mode 100644 index 00000000000..ee40f8b0470 --- /dev/null +++ b/.automation/test/csharp/csharp_bad_04.cs @@ -0,0 +1,13 @@ +using System; + +namespace HelloWorld +{ + class Program + { + static void Main (string[] args) + { + Console.WriteLine ("Hello World!"); + var value = 3 * 4 + 5; + } + } +} diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index f06ba66ae21..9e8cfaf3375 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,7 +32,13 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include csharp_bad_01.cs '/tmp/lint/.automation/test/csharp/csharp_bad_02.cs' 'tmp/lint/.automation/test/csharp/csharp_good_01.cs' './tmp/lint/.automation/test/csharp/csharp_good_02.cs' + - command: set -x + cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include "/tmp/lint/.automation/test/csharp/csharp_bad_01.cs" "./tmp/lint/.automation/test/csharp/csharp_bad_02.cs" 'tmp/lint/.automation/test/csharp/csharp_good_03.cs' './tmp/lint/.automation/test/csharp/csharp_good_04.cs' + cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/ + cwd: "/" + - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/*.cs cwd: "/" - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d cwd: "/" From e5603c2709817561c969c02fc3cc05b56eac7a6c Mon Sep 17 00:00:00 2001 From: Lex Date: Wed, 30 Nov 2022 10:05:32 -0300 Subject: [PATCH 56/76] Testing echo --- .../descriptors/csharp.megalinter-descriptor.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 9e8cfaf3375..bcbc2708097 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,15 +32,15 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: set -x + - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include "/tmp/lint/.automation/test/csharp/csharp_bad_01.cs" "./tmp/lint/.automation/test/csharp/csharp_bad_02.cs" 'tmp/lint/.automation/test/csharp/csharp_good_03.cs' './tmp/lint/.automation/test/csharp/csharp_good_04.cs' cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include "/tmp/lint/.automation/test/csharp/csharp_bad_01.cs" "./tmp/lint/.automation/test/csharp/csharp_bad_02.cs" 'tmp/lint/.automation/test/csharp/csharp_good_03.cs' './tmp/lint/.automation/test/csharp/csharp_good_04.cs' + - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include *.* cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/ + - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/*.* cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/*.cs + - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/*.cs cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d + - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet From 912ae6b1f72b73e8d522e452f10a8e8d29598147 Mon Sep 17 00:00:00 2001 From: Lex Date: Wed, 30 Nov 2022 11:29:42 -0300 Subject: [PATCH 57/76] More tests --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index bcbc2708097..6a1160714f2 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,7 +32,9 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: - - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include "/tmp/lint/.automation/test/csharp/csharp_bad_01.cs" "./tmp/lint/.automation/test/csharp/csharp_bad_02.cs" 'tmp/lint/.automation/test/csharp/csharp_good_03.cs' './tmp/lint/.automation/test/csharp/csharp_good_04.cs' + - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs + cwd: "/" + - command: set -x;dotnet format ./tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs cwd: "/" - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include *.* cwd: "/" @@ -42,6 +44,8 @@ linters: cwd: "/" - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d cwd: "/" + - command: echo $PATH + cwd: "/" cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: From dc97fd840c0abd44fbcc2336bcba152c400fcfdf Mon Sep 17 00:00:00 2001 From: Lex Date: Wed, 30 Nov 2022 22:25:25 -0300 Subject: [PATCH 58/76] Checking versions --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 6a1160714f2..5e993b5e70a 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -32,6 +32,10 @@ linters: linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png pre_commands: + - command: dotnet --version + cwd: "/" + - command: dotnet format --version + cwd: "/" - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs cwd: "/" - command: set -x;dotnet format ./tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs From 028dce96f1399caf544e57b444be3598ee58720f Mon Sep 17 00:00:00 2001 From: Lex Date: Wed, 30 Nov 2022 22:31:29 -0300 Subject: [PATCH 59/76] Adding dotnet --info --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 5e993b5e70a..b1b5425510e 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -34,6 +34,8 @@ linters: pre_commands: - command: dotnet --version cwd: "/" + - command: dotnet --info + cwd: "/" - command: dotnet format --version cwd: "/" - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs From a189a83e17a2eda4b4eea620c60a687d5db73754 Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 1 Dec 2022 08:42:22 -0300 Subject: [PATCH 60/76] Upgrade to dotnet 7 and removed list_of_files --- .automation/generated/linter-versions.json | 2 +- Dockerfile | 4 +-- flavors/dotnet/Dockerfile | 6 ++-- flavors/security/Dockerfile | 2 +- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 2 +- linters/sql_tsqllint/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- .../csharp.megalinter-descriptor.yml | 31 ++----------------- .../repository.megalinter-descriptor.yml | 2 +- .../descriptors/sql.megalinter-descriptor.yml | 2 +- .../vbdotnet.megalinter-descriptor.yml | 15 ++------- 12 files changed, 19 insertions(+), 53 deletions(-) diff --git a/.automation/generated/linter-versions.json b/.automation/generated/linter-versions.json index ac11b8c65db..5ebfc845da5 100644 --- a/.automation/generated/linter-versions.json +++ b/.automation/generated/linter-versions.json @@ -21,7 +21,7 @@ "djlint": "1.19.7", "dockerfilelint": "1.8.0", "dotenv-linter": "3.2.0", - "dotnet-format": "6.3.322007", + "dotnet-format": "000", "dustilock": "0.0.0", "editorconfig-checker": "2.4.0", "eslint": "8.28.0", diff --git a/Dockerfile b/Dockerfile index 1d5b74f9710..daa1d3b41bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -321,7 +321,7 @@ RUN rc-update add docker boot && rc-service docker start || true \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -373,7 +373,7 @@ RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index e1673cc41a1..c0554d04fbc 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -233,7 +233,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -253,7 +253,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -352,7 +352,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" && dotnet tool install --global TSQLLint diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 3f2a8387951..70f93ac05e1 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -210,7 +210,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil # devskim installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index 1eb15fb93e8..d7375a676dc 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 69033ea8693..6703a2c007d 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -132,7 +132,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/linters/sql_tsqllint/Dockerfile b/linters/sql_tsqllint/Dockerfile index 1786943fea0..ac4c25bd54d 100644 --- a/linters/sql_tsqllint/Dockerfile +++ b/linters/sql_tsqllint/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # tsqllint installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index 77dd03eafa9..f416ce3959d 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index b1b5425510e..4d530ebb315 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT @@ -31,40 +31,15 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: - - command: dotnet --version - cwd: "/" - - command: dotnet --info - cwd: "/" - - command: dotnet format --version - cwd: "/" - - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs - cwd: "/" - - command: set -x;dotnet format ./tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/csharp_bad_01.cs ./tmp/lint/.automation/test/csharp/csharp_bad_02.cs tmp/lint/.automation/test/csharp/csharp_good_03.cs ~/tmp/lint/.automation/test/csharp/csharp_good_04.cs - cwd: "/" - - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include *.* - cwd: "/" - - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/*.* - cwd: "/" - - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d --include /tmp/lint/.automation/test/csharp/*.cs - cwd: "/" - - command: set -x;dotnet format /tmp/lint/.automation/test/csharp --verify-no-changes -v d - cwd: "/" - - command: echo $PATH - cwd: "/" - cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: - "format" - "{{WORKSPACE}}" - "--verify-no-changes" - - "-v" - - "d" - - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround for DotnetFormatLinter class behavior cli_lint_fix_remove_args: - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet format --verify-no-changes --include myfile.cs myfile2.cs" - - "dotnet format --include myfile.cs myfile2.cs" # Fix + - "dotnet format {{WORKSPACE}} --verify-no-changes" + - "dotnet format {{WORKSPACE}}" # Fix diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 261de2a2213..c1987d103b4 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -91,7 +91,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI ide: diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index 7329efc732f..087740153f3 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -82,7 +82,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global TSQLLint ide: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index b4689844991..27f02d984e1 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT @@ -31,24 +31,15 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: - - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d --include /vbdotnet_bad_01.cs '/vbdotnet_bad_02.cs' './vbdotnet_good_01.cs' '\tmp\lint\.automation\test\vbdotnet\vbdotnet_good_02.cs' - cwd: "/" - - command: dotnet format /tmp/lint/.automation/test/vbdotnet --verify-no-changes -v d - cwd: "/" - cli_lint_mode: list_of_files cli_executable: dotnet cli_lint_extra_args: - "format" - "{{WORKSPACE}}" - "--verify-no-changes" - - "-v" - - "d" - - "--include" cli_lint_fix_arg_name: "--megalinter-fix-flag" # Workaround to allow fix cli_lint_fix_remove_args: - "--verify-no-changes" linter_version_cache: "000" examples: - - "dotnet format --verify-no-changes --include myfile.vb myfile2.vb" - - "dotnet format --include myfile.vb myfile2.vb" + - "dotnet format {{WORKSPACE}} --verify-no-changes" + - "dotnet format {{WORKSPACE}}" # Fix From 8ba59da17014ef38eb551a2393f4906829d49174 Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 1 Dec 2022 09:39:10 -0300 Subject: [PATCH 61/76] Revert some changes for --list-of-files --- .automation/test/csharp/.editorconfig | 67 ------------------------ .automation/test/csharp/csharp_bad_03.cs | 13 ----- .automation/test/csharp/csharp_bad_04.cs | 13 ----- .automation/test/vbdotnet/.editorconfig | 67 ------------------------ megalinter/linters/DotnetFormatLinter.py | 26 +++------ 5 files changed, 7 insertions(+), 179 deletions(-) delete mode 100644 .automation/test/csharp/.editorconfig delete mode 100644 .automation/test/csharp/csharp_bad_03.cs delete mode 100644 .automation/test/csharp/csharp_bad_04.cs delete mode 100644 .automation/test/vbdotnet/.editorconfig diff --git a/.automation/test/csharp/.editorconfig b/.automation/test/csharp/.editorconfig deleted file mode 100644 index 0c48b2017a5..00000000000 --- a/.automation/test/csharp/.editorconfig +++ /dev/null @@ -1,67 +0,0 @@ -# Remove the line below if you want to inherit .editorconfig settings from higher directories -root = true - -# C# files -[*.cs] - -#### Core EditorConfig Options #### - -# Indentation and spacing -indent_size = 4 -indent_style = tab -tab_width = 4 - -# New line preferences -insert_final_newline = true - -#### .NET Coding Conventions #### - -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false -file_header_template = unset - -# this. and Me. preferences -dotnet_style_qualification_for_event = false:warning -dotnet_style_qualification_for_field = false -dotnet_style_qualification_for_method = false:warning -dotnet_style_qualification_for_property = false:warning - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true:warning -dotnet_style_predefined_type_for_member_access = true:warning - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = for_non_interface_members - -# Expression-level preferences -dotnet_style_coalesce_expression = true:warning -dotnet_style_collection_initializer = true:warning -dotnet_style_explicit_tuple_names = true:warning -dotnet_style_namespace_match_folder = true -dotnet_style_null_propagation = true:warning -dotnet_style_object_initializer = true:warning -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_prefer_auto_properties = true:warning -dotnet_style_prefer_compound_assignment = true -dotnet_style_prefer_conditional_expression_over_assignment = false -dotnet_style_prefer_conditional_expression_over_return = false -dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed -dotnet_style_prefer_inferred_anonymous_type_member_names = true -dotnet_style_prefer_inferred_tuple_names = true -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_simplified_boolean_expressions = true:warning -dotnet_style_prefer_simplified_interpolation = true - -# Field preferences -dotnet_style_readonly_field = true:warning - -# New line preferences -dotnet_style_allow_multiple_blank_lines_experimental = false:warning -dotnet_style_allow_statement_immediately_after_block_experimental = false:warning diff --git a/.automation/test/csharp/csharp_bad_03.cs b/.automation/test/csharp/csharp_bad_03.cs deleted file mode 100644 index ee40f8b0470..00000000000 --- a/.automation/test/csharp/csharp_bad_03.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace HelloWorld -{ - class Program - { - static void Main (string[] args) - { - Console.WriteLine ("Hello World!"); - var value = 3 * 4 + 5; - } - } -} diff --git a/.automation/test/csharp/csharp_bad_04.cs b/.automation/test/csharp/csharp_bad_04.cs deleted file mode 100644 index ee40f8b0470..00000000000 --- a/.automation/test/csharp/csharp_bad_04.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace HelloWorld -{ - class Program - { - static void Main (string[] args) - { - Console.WriteLine ("Hello World!"); - var value = 3 * 4 + 5; - } - } -} diff --git a/.automation/test/vbdotnet/.editorconfig b/.automation/test/vbdotnet/.editorconfig deleted file mode 100644 index 3c51e38c6cc..00000000000 --- a/.automation/test/vbdotnet/.editorconfig +++ /dev/null @@ -1,67 +0,0 @@ -# Remove the line below if you want to inherit .editorconfig settings from higher directories -root = true - -# VB files -[*.vb] - -#### Core EditorConfig Options #### - -# Indentation and spacing -indent_size = 4 -indent_style = tab -tab_width = 4 - -# New line preferences -insert_final_newline = true - -#### .NET Coding Conventions #### - -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false -file_header_template = unset - -# this. and Me. preferences -dotnet_style_qualification_for_event = false:warning -dotnet_style_qualification_for_field = false -dotnet_style_qualification_for_method = false:warning -dotnet_style_qualification_for_property = false:warning - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true:warning -dotnet_style_predefined_type_for_member_access = true:warning - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = for_non_interface_members - -# Expression-level preferences -dotnet_style_coalesce_expression = true:warning -dotnet_style_collection_initializer = true:warning -dotnet_style_explicit_tuple_names = true:warning -dotnet_style_namespace_match_folder = true -dotnet_style_null_propagation = true:warning -dotnet_style_object_initializer = true:warning -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_prefer_auto_properties = true:warning -dotnet_style_prefer_compound_assignment = true -dotnet_style_prefer_conditional_expression_over_assignment = false -dotnet_style_prefer_conditional_expression_over_return = false -dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed -dotnet_style_prefer_inferred_anonymous_type_member_names = true -dotnet_style_prefer_inferred_tuple_names = true -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_simplified_boolean_expressions = true:warning -dotnet_style_prefer_simplified_interpolation = true - -# Field preferences -dotnet_style_readonly_field = true:warning - -# New line preferences -dotnet_style_allow_multiple_blank_lines_experimental = false:warning -dotnet_style_allow_statement_immediately_after_block_experimental = false:warning diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index f4dedaa2e5f..ea5c8abc3b3 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -12,22 +12,10 @@ class DotnetFormatLinter(Linter): # Build the CLI command to call to lint a file def build_lint_command(self, file=None): - if file is not None: - # cli_lint_mode = file - file = os.path.basename(file) - dotnet_format_command = " ".join(super().build_lint_command(file)) - commands = [ - f'cd "{os.path.realpath(os.path.dirname(file))}" || exit 1', - dotnet_format_command + " | tee /dev/tty2 2>&1", - 'exit "${PIPESTATUS[0]}"', - ] - - else: - return super().build_lint_command(None) - # cli_lint_mode = list_of_files or project - # dotnet_format_command = " ".join(super().build_lint_command(None)) - # commands = [ - # dotnet_format_command + " | tee /dev/tty2 2>&1", - # 'exit "${PIPESTATUS[0]}"', - #] - # return " && ".join(commands) + commands = [ + f'cd "{os.path.realpath(os.path.dirname(file))}" || exit 1', + " ".join(super().build_lint_command(os.path.basename(file))) + + " | tee /dev/tty2 2>&1", + 'exit "${PIPESTATUS[0]}"', + ] + return " && ".join(commands) From 1e0944af9c2e2aea0a1e965fb913164d65c86f4f Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 1 Dec 2022 21:23:40 -0300 Subject: [PATCH 62/76] More experiments --- .../csharp.megalinter-descriptor.yml | 7 +++++ megalinter/linters/DotnetFormatLinter.py | 26 ++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 4d530ebb315..f7db5f2350c 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,6 +31,13 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png + pre_commands: + - command: dotnet --version + cwd: "/" + - command: dotnet --info + cwd: "/" + - command: dotnet format --version + cwd: "/" cli_executable: dotnet cli_lint_extra_args: - "format" diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index ea5c8abc3b3..6815f6b64f9 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -12,10 +12,22 @@ class DotnetFormatLinter(Linter): # Build the CLI command to call to lint a file def build_lint_command(self, file=None): - commands = [ - f'cd "{os.path.realpath(os.path.dirname(file))}" || exit 1', - " ".join(super().build_lint_command(os.path.basename(file))) - + " | tee /dev/tty2 2>&1", - 'exit "${PIPESTATUS[0]}"', - ] - return " && ".join(commands) + if file is not None: + # cli_lint_mode = file + file = os.path.basename(file) + dotnet_format_command = " ".join(super().build_lint_command(file)) + commands = [ + f'cd "{os.path.realpath(os.path.dirname(file))}" || exit 1', + dotnet_format_command + " | tee /dev/tty2 2>&1", + 'exit "${PIPESTATUS[0]}"', + ] + + else: + return super().build_lint_command(None) + # cli_lint_mode = list_of_files or project + dotnet_format_command = " ".join(super().build_lint_command(None)) + commands = [ + dotnet_format_command + " | tee /dev/tty2 2>&1", + 'exit "${PIPESTATUS[0]}"', + ] + return " && ".join(commands) From b6e30f3e0d845ef2cfa628192eff39f0a3c67f2c Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 1 Dec 2022 21:24:13 -0300 Subject: [PATCH 63/76] Ops --- megalinter/linters/DotnetFormatLinter.py | 1 - 1 file changed, 1 deletion(-) diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index 6815f6b64f9..22f3a851e15 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -23,7 +23,6 @@ def build_lint_command(self, file=None): ] else: - return super().build_lint_command(None) # cli_lint_mode = list_of_files or project dotnet_format_command = " ".join(super().build_lint_command(None)) commands = [ From b220d13a36f8aa5e2928e5302c3cab012c11d156 Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 1 Dec 2022 23:59:22 -0300 Subject: [PATCH 64/76] Fixing malformed file --- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index f7db5f2350c..a9a7645db66 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -31,7 +31,7 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: + pre_commands: - command: dotnet --version cwd: "/" - command: dotnet --info From bd24fc07abd1a5941297aceec62c0898cdb3ccfe Mon Sep 17 00:00:00 2001 From: Lex Date: Fri, 2 Dec 2022 07:48:22 -0300 Subject: [PATCH 65/76] Whoa, python sux --- megalinter/linters/DotnetFormatLinter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index 22f3a851e15..e32bbf133a7 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -29,4 +29,4 @@ def build_lint_command(self, file=None): dotnet_format_command + " | tee /dev/tty2 2>&1", 'exit "${PIPESTATUS[0]}"', ] - return " && ".join(commands) + return " && ".join(commands) From 01c88dcbadfce2498329ddcc38cefe463c71f423 Mon Sep 17 00:00:00 2001 From: Lex Date: Fri, 2 Dec 2022 11:34:01 -0300 Subject: [PATCH 66/76] Change dotnet command --- megalinter/linters/DotnetFormatLinter.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index e32bbf133a7..b085bda1e14 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -12,21 +12,10 @@ class DotnetFormatLinter(Linter): # Build the CLI command to call to lint a file def build_lint_command(self, file=None): - if file is not None: - # cli_lint_mode = file - file = os.path.basename(file) - dotnet_format_command = " ".join(super().build_lint_command(file)) - commands = [ - f'cd "{os.path.realpath(os.path.dirname(file))}" || exit 1', - dotnet_format_command + " | tee /dev/tty2 2>&1", - 'exit "${PIPESTATUS[0]}"', - ] - - else: - # cli_lint_mode = list_of_files or project - dotnet_format_command = " ".join(super().build_lint_command(None)) - commands = [ - dotnet_format_command + " | tee /dev/tty2 2>&1", - 'exit "${PIPESTATUS[0]}"', - ] + # cli_lint_mode = list_of_files or project + dotnet_format_command = " ".join(super().build_lint_command(None)) + commands = [ + dotnet_format_command + " | tee /dev/tty2 2>&1", + 'exit "${PIPESTATUS[0]}"', + ] return " && ".join(commands) From 699d6ad48aa4951658d2b6176e7089ec3eded492 Mon Sep 17 00:00:00 2001 From: Lex Date: Fri, 2 Dec 2022 12:46:39 -0300 Subject: [PATCH 67/76] Updating reports for tests --- .../reports/ERROR-CSHARP_DOTNET_FORMAT.txt | 13 +++++++++--- .../reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt | 2 +- .../reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt | 21 ++++++++++++++----- .../SUCCESS-VBDOTNET_DOTNET_FORMAT.txt | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt index b9d54d2b484..515d7c368b6 100644 --- a/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/ERROR-CSHARP_DOTNET_FORMAT.txt @@ -1,7 +1,14 @@ -Results of dotnet-format linter (version 6.3.322007) +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 - .automation/test/csharp/csharp_bad_01.cs(5,18): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s'. [.automation/test/csharp/csharp_project.csproj] +❌ [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] diff --git a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt index 7a4db7a1fb3..a0c3ce38668 100644 --- a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt @@ -1,4 +1,4 @@ -Results of dotnet-format linter (version 6.3.322007) +Results of dotnet-format linter (version 000) See documentation on https://megalinter.github.io/descriptors/csharp_dotnet_format/ ----------------------------------------------- diff --git a/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt index 62eb048be61..cb2efbaa8ee 100644 --- a/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/ERROR-VBDOTNET_DOTNET_FORMAT.txt @@ -1,9 +1,20 @@ -Results of dotnet-format linter (version 6.3.322007) +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 - .automation/test/vbdotnet/vbdotnet_bad_1.vb(3,20): error WHITESPACE: Fix whitespace formatting. Replace 4 characters with '\r\n\s\s\s\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(4,23): error WHITESPACE: Fix whitespace formatting. Replace 7 characters with '\r\n\s\s\s\s\s\s\s\s'. [.automation/test/vbdotnet/vb_projecty.vbproj] +❌ [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] diff --git a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt index 5a77a006107..2d2a1bcfe41 100644 --- a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt @@ -1,4 +1,4 @@ -Results of dotnet-format linter (version 6.3.322007) +Results of dotnet-format linter (version 000) See documentation on https://megalinter.github.io/descriptors/vbdotnet_dotnet_format/ ----------------------------------------------- From 1ec2faddf82624e14a05e4efb1750f17026ebb0b Mon Sep 17 00:00:00 2001 From: Lex Date: Fri, 2 Dec 2022 14:20:33 -0300 Subject: [PATCH 68/76] Success linters also format bad files --- .../reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt | 10 +++++++++- .../reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt index a0c3ce38668..515d7c368b6 100644 --- a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt @@ -2,5 +2,13 @@ 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 +❌ [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] diff --git a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt index 2d2a1bcfe41..cb2efbaa8ee 100644 --- a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt @@ -2,5 +2,19 @@ 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 +❌ [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] From 83d327770bd0b0ff168cf86f22f2d258646ea648 Mon Sep 17 00:00:00 2001 From: Lex Date: Fri, 2 Dec 2022 22:51:38 -0300 Subject: [PATCH 69/76] Separating good and bad test projects --- .automation/test/csharp/{ => bad}/csharp_bad_01.cs | 0 .automation/test/csharp/{ => bad}/csharp_bad_02.cs | 0 .../test/csharp/{ => bad}/csharp_project.csproj | 0 .automation/test/csharp/{ => good}/csharp_good_01.cs | 0 .automation/test/csharp/{ => good}/csharp_good_02.cs | 0 .automation/test/csharp/good/csharp_project.csproj | 10 ++++++++++ .automation/test/vbdotnet/{ => bad}/vb_projecty.vbproj | 0 .automation/test/vbdotnet/{ => bad}/vbdotnet_bad_1.vb | 0 .automation/test/vbdotnet/{ => bad}/vbdotnet_bad_2.vb | 0 .automation/test/vbdotnet/good/vb_projecty.vbproj | 9 +++++++++ .../test/vbdotnet/{ => good}/vbdotnet_good_1.vb | 0 .../test/vbdotnet/{ => good}/vbdotnet_good_2.vb | 0 12 files changed, 19 insertions(+) rename .automation/test/csharp/{ => bad}/csharp_bad_01.cs (100%) rename .automation/test/csharp/{ => bad}/csharp_bad_02.cs (100%) rename .automation/test/csharp/{ => bad}/csharp_project.csproj (100%) rename .automation/test/csharp/{ => good}/csharp_good_01.cs (100%) rename .automation/test/csharp/{ => good}/csharp_good_02.cs (100%) create mode 100644 .automation/test/csharp/good/csharp_project.csproj rename .automation/test/vbdotnet/{ => bad}/vb_projecty.vbproj (100%) rename .automation/test/vbdotnet/{ => bad}/vbdotnet_bad_1.vb (100%) rename .automation/test/vbdotnet/{ => bad}/vbdotnet_bad_2.vb (100%) create mode 100644 .automation/test/vbdotnet/good/vb_projecty.vbproj rename .automation/test/vbdotnet/{ => good}/vbdotnet_good_1.vb (100%) rename .automation/test/vbdotnet/{ => good}/vbdotnet_good_2.vb (100%) diff --git a/.automation/test/csharp/csharp_bad_01.cs b/.automation/test/csharp/bad/csharp_bad_01.cs similarity index 100% rename from .automation/test/csharp/csharp_bad_01.cs rename to .automation/test/csharp/bad/csharp_bad_01.cs diff --git a/.automation/test/csharp/csharp_bad_02.cs b/.automation/test/csharp/bad/csharp_bad_02.cs similarity index 100% rename from .automation/test/csharp/csharp_bad_02.cs rename to .automation/test/csharp/bad/csharp_bad_02.cs diff --git a/.automation/test/csharp/csharp_project.csproj b/.automation/test/csharp/bad/csharp_project.csproj similarity index 100% rename from .automation/test/csharp/csharp_project.csproj rename to .automation/test/csharp/bad/csharp_project.csproj diff --git a/.automation/test/csharp/csharp_good_01.cs b/.automation/test/csharp/good/csharp_good_01.cs similarity index 100% rename from .automation/test/csharp/csharp_good_01.cs rename to .automation/test/csharp/good/csharp_good_01.cs diff --git a/.automation/test/csharp/csharp_good_02.cs b/.automation/test/csharp/good/csharp_good_02.cs similarity index 100% rename from .automation/test/csharp/csharp_good_02.cs rename to .automation/test/csharp/good/csharp_good_02.cs diff --git a/.automation/test/csharp/good/csharp_project.csproj b/.automation/test/csharp/good/csharp_project.csproj new file mode 100644 index 00000000000..74abf5c9766 --- /dev/null +++ b/.automation/test/csharp/good/csharp_project.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/.automation/test/vbdotnet/vb_projecty.vbproj b/.automation/test/vbdotnet/bad/vb_projecty.vbproj similarity index 100% rename from .automation/test/vbdotnet/vb_projecty.vbproj rename to .automation/test/vbdotnet/bad/vb_projecty.vbproj diff --git a/.automation/test/vbdotnet/vbdotnet_bad_1.vb b/.automation/test/vbdotnet/bad/vbdotnet_bad_1.vb similarity index 100% rename from .automation/test/vbdotnet/vbdotnet_bad_1.vb rename to .automation/test/vbdotnet/bad/vbdotnet_bad_1.vb diff --git a/.automation/test/vbdotnet/vbdotnet_bad_2.vb b/.automation/test/vbdotnet/bad/vbdotnet_bad_2.vb similarity index 100% rename from .automation/test/vbdotnet/vbdotnet_bad_2.vb rename to .automation/test/vbdotnet/bad/vbdotnet_bad_2.vb diff --git a/.automation/test/vbdotnet/good/vb_projecty.vbproj b/.automation/test/vbdotnet/good/vb_projecty.vbproj new file mode 100644 index 00000000000..3edb2ae4157 --- /dev/null +++ b/.automation/test/vbdotnet/good/vb_projecty.vbproj @@ -0,0 +1,9 @@ + + + + Exe + vb_projecty + net6.0 + + + diff --git a/.automation/test/vbdotnet/vbdotnet_good_1.vb b/.automation/test/vbdotnet/good/vbdotnet_good_1.vb similarity index 100% rename from .automation/test/vbdotnet/vbdotnet_good_1.vb rename to .automation/test/vbdotnet/good/vbdotnet_good_1.vb diff --git a/.automation/test/vbdotnet/vbdotnet_good_2.vb b/.automation/test/vbdotnet/good/vbdotnet_good_2.vb similarity index 100% rename from .automation/test/vbdotnet/vbdotnet_good_2.vb rename to .automation/test/vbdotnet/good/vbdotnet_good_2.vb From cc9946930c0c6a9a56f7e3c831cd313a184d6036 Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 3 Dec 2022 08:00:00 -0300 Subject: [PATCH 70/76] Revert back to dotnet6 --- Dockerfile | 4 ++-- flavors/dotnet/Dockerfile | 6 +++--- flavors/security/Dockerfile | 2 +- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 2 +- linters/sql_tsqllint/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- megalinter/descriptors/csharp.megalinter-descriptor.yml | 9 +-------- .../descriptors/repository.megalinter-descriptor.yml | 2 +- megalinter/descriptors/sql.megalinter-descriptor.yml | 2 +- .../descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 11 files changed, 14 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index daa1d3b41bf..1d5b74f9710 100644 --- a/Dockerfile +++ b/Dockerfile @@ -321,7 +321,7 @@ RUN rc-update add docker boot && rc-service docker start || true \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -373,7 +373,7 @@ RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index c0554d04fbc..e1673cc41a1 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -233,7 +233,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -253,7 +253,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -352,7 +352,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" && dotnet tool install --global TSQLLint diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 70f93ac05e1..3f2a8387951 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -210,7 +210,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil # devskim installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index d7375a676dc..1eb15fb93e8 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 6703a2c007d..69033ea8693 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -132,7 +132,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/linters/sql_tsqllint/Dockerfile b/linters/sql_tsqllint/Dockerfile index ac4c25bd54d..1786943fea0 100644 --- a/linters/sql_tsqllint/Dockerfile +++ b/linters/sql_tsqllint/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # tsqllint installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index f416ce3959d..77dd03eafa9 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index a9a7645db66..3bd7a082f7a 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT @@ -31,13 +31,6 @@ linters: linter_url: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-format linter_repo: https://github.com/dotnet/format linter_image_url: https://user-images.githubusercontent.com/9797472/61659851-6bbdc880-ac7d-11e9-95f7-d30c7de1a18a.png - pre_commands: - - command: dotnet --version - cwd: "/" - - command: dotnet --info - cwd: "/" - - command: dotnet format --version - cwd: "/" cli_executable: dotnet cli_lint_extra_args: - "format" diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index c1987d103b4..261de2a2213 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -91,7 +91,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI ide: diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index 087740153f3..7329efc732f 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -82,7 +82,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global TSQLLint ide: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 27f02d984e1..973218a56ad 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT From 46a5a1a0af9211c649a24d5635b341aefd8e945b Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 3 Dec 2022 08:00:12 -0300 Subject: [PATCH 71/76] Updated success report files --- .../reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt | 12 ++++-------- .../reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt | 18 ++++-------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt index 515d7c368b6..8501088c00d 100644 --- a/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt +++ b/.automation/test/csharp/reports/SUCCESS-CSHARP_DOTNET_FORMAT.txt @@ -2,13 +2,9 @@ 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 - .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] +✅ [SUCCESS] .automation/test/csharp/good/csharp_good_01.cs + -❌ [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] +✅ [SUCCESS] .automation/test/csharp/good/csharp_good_02.cs + diff --git a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt index cb2efbaa8ee..ba77aa8104b 100644 --- a/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt +++ b/.automation/test/vbdotnet/reports/SUCCESS-VBDOTNET_DOTNET_FORMAT.txt @@ -2,19 +2,9 @@ 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 - .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] +✅ [SUCCESS] .automation/test/vbdotnet/good/vbdotnet_good_1.vb + -❌ [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] +✅ [SUCCESS] .automation/test/vbdotnet/good/vbdotnet_good_2.vb + From e54901b4086523d8efe2ed299b694b83b5d7e136 Mon Sep 17 00:00:00 2001 From: Lex Date: Sat, 3 Dec 2022 09:15:34 -0300 Subject: [PATCH 72/76] Removing unused import from DotnetFormatLinter.py --- megalinter/linters/DotnetFormatLinter.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/megalinter/linters/DotnetFormatLinter.py b/megalinter/linters/DotnetFormatLinter.py index b085bda1e14..b7a47cc6060 100644 --- a/megalinter/linters/DotnetFormatLinter.py +++ b/megalinter/linters/DotnetFormatLinter.py @@ -3,8 +3,6 @@ Use dotnet-format to lint CSharp files """ -import os.path - from megalinter import Linter From 7630633e5db732ef6e85497f5c3adc958962b712 Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 5 Jan 2023 18:53:05 -0300 Subject: [PATCH 73/76] Upgrade to dotnet 7 --- CHANGELOG.md | 4 +--- Dockerfile | 8 ++++---- flavors/dotnet/Dockerfile | 6 +++--- flavors/security/Dockerfile | 2 +- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 2 +- linters/sql_tsqllint/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- .../descriptors/repository.megalinter-descriptor.yml | 2 +- megalinter/descriptors/sql.megalinter-descriptor.yml | 2 +- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 12 files changed, 17 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f77149468..d006d22b06a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,8 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Drone CI enhancements - Config generator tool now supports Drone CI - Added information about how to change trigger rules for Drone CI workflow - - Fix perl linter skipping files - -- Upgrade to dotnet 6.0 + `list_of_files` for dotnet-format CLI lint mode to improve performances (requires `.csproj` or `.vbproj` in the repo) +- Upgrade to dotnet 7.0, dotnet-format requires `.sln`, `.csproj` or `.vbproj` in the repo - Linter versions upgrades - [csharpier](https://csharpier.com/) from 0.21.0 to **0.16.0** on 2022-12-29 diff --git a/Dockerfile b/Dockerfile index 8e12c08d585..fabd0f8eb99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -313,7 +313,7 @@ RUN rc-update add docker boot && rc-service docker start || true \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -366,7 +366,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -544,7 +544,7 @@ ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ @@ -601,7 +601,7 @@ RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" && dotnet tool install --global TSQLLint \ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index acfd275e6ac..69350889c13 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -235,7 +235,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -255,7 +255,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -362,7 +362,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" && dotnet tool install --global TSQLLint diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index b60ecf2fb4b..0299fd00920 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -210,7 +210,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil # devskim installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index 1eb15fb93e8..d7375a676dc 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index fc1f575613c..70dd25033e9 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -132,7 +132,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/linters/sql_tsqllint/Dockerfile b/linters/sql_tsqllint/Dockerfile index 1786943fea0..ac4c25bd54d 100644 --- a/linters/sql_tsqllint/Dockerfile +++ b/linters/sql_tsqllint/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # tsqllint installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index 77dd03eafa9..f416ce3959d 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 4d20a2545a3..1ca4a31aefc 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index a5cc9581ee9..29ccda64168 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -92,7 +92,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI ide: diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index 7329efc732f..087740153f3 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -82,7 +82,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global TSQLLint ide: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 973218a56ad..27f02d984e1 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT From 7a8d0945b2a9b6d0b6674c3b41c1243027558f0f Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 5 Jan 2023 20:23:16 -0300 Subject: [PATCH 74/76] Removing csharpier version specification from install cli --- Dockerfile | 2 +- flavors/dotnet/Dockerfile | 2 +- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fabd0f8eb99..2cc898cabe4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -408,7 +408,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ && /usr/share/dotnet/dotnet tool install -g dotnet-format \ # csharpier installation - && /usr/share/dotnet/dotnet tool install -g csharpier --version 0.16.0 \ + && /usr/share/dotnet/dotnet tool install -g csharpier \ # dartanalyzer installation && wget --tries=50 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index 69350889c13..16f938f69c0 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -294,7 +294,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ && /usr/share/dotnet/dotnet tool install -g dotnet-format \ # csharpier installation - && /usr/share/dotnet/dotnet tool install -g csharpier --version 0.16.0 \ + && /usr/share/dotnet/dotnet tool install -g csharpier \ # hadolint installation # Managed with COPY --from=hadolint /bin/hadolint /usr/bin/hadolint diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index 1ca4a31aefc..fd194279301 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -67,7 +67,7 @@ linters: - "dotnet csharpier myfile.cs myfile2.cs" # Fix install: dockerfile: - - RUN /usr/share/dotnet/dotnet tool install -g csharpier --version 0.16.0 + - RUN /usr/share/dotnet/dotnet tool install -g csharpier ide: rider: - name: csharpier From bde05c3397538d16cde951c889d520519b2a66bc Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 5 Jan 2023 22:44:05 -0300 Subject: [PATCH 75/76] Revert "Upgrade to dotnet 7" This reverts commit 7630633e5db732ef6e85497f5c3adc958962b712. --- CHANGELOG.md | 4 +++- Dockerfile | 8 ++++---- flavors/dotnet/Dockerfile | 6 +++--- flavors/security/Dockerfile | 2 +- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/repository_devskim/Dockerfile | 2 +- linters/sql_tsqllint/Dockerfile | 2 +- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- megalinter/descriptors/csharp.megalinter-descriptor.yml | 2 +- .../descriptors/repository.megalinter-descriptor.yml | 2 +- megalinter/descriptors/sql.megalinter-descriptor.yml | 2 +- megalinter/descriptors/vbdotnet.megalinter-descriptor.yml | 2 +- 12 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d006d22b06a..54f77149468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,10 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Drone CI enhancements - Config generator tool now supports Drone CI - Added information about how to change trigger rules for Drone CI workflow + - Fix perl linter skipping files -- Upgrade to dotnet 7.0, dotnet-format requires `.sln`, `.csproj` or `.vbproj` in the repo + +- Upgrade to dotnet 6.0 + `list_of_files` for dotnet-format CLI lint mode to improve performances (requires `.csproj` or `.vbproj` in the repo) - Linter versions upgrades - [csharpier](https://csharpier.com/) from 0.21.0 to **0.16.0** on 2022-12-29 diff --git a/Dockerfile b/Dockerfile index 2cc898cabe4..c05f82fd386 100644 --- a/Dockerfile +++ b/Dockerfile @@ -313,7 +313,7 @@ RUN rc-update add docker boot && rc-service docker start || true \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -366,7 +366,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -544,7 +544,7 @@ ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ @@ -601,7 +601,7 @@ RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" && dotnet tool install --global TSQLLint \ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index 16f938f69c0..ee426e386d3 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -235,7 +235,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # CSHARP installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -255,7 +255,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" @@ -362,7 +362,7 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \ # Next line commented because already managed by another linter # RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ # && chmod +x dotnet-install.sh \ -# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest +# && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest # Next line commented because already managed by another linter # ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" && dotnet tool install --global TSQLLint diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 0299fd00920..b60ecf2fb4b 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -210,7 +210,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil # devskim installation && wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI \ diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index d7375a676dc..1eb15fb93e8 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # CSHARP installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 70dd25033e9..fc1f575613c 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -132,7 +132,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ # devskim installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI diff --git a/linters/sql_tsqllint/Dockerfile b/linters/sql_tsqllint/Dockerfile index ac4c25bd54d..1786943fea0 100644 --- a/linters/sql_tsqllint/Dockerfile +++ b/linters/sql_tsqllint/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # tsqllint installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" RUN dotnet tool install --global TSQLLint diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index f416ce3959d..77dd03eafa9 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/node_modules/.bin:${PATH}" # VBDOTNET installation RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" diff --git a/megalinter/descriptors/csharp.megalinter-descriptor.yml b/megalinter/descriptors/csharp.megalinter-descriptor.yml index fd194279301..c66d739a331 100644 --- a/megalinter/descriptors/csharp.megalinter-descriptor.yml +++ b/megalinter/descriptors/csharp.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 29ccda64168..a5cc9581ee9 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -92,7 +92,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI ide: diff --git a/megalinter/descriptors/sql.megalinter-descriptor.yml b/megalinter/descriptors/sql.megalinter-descriptor.yml index 087740153f3..7329efc732f 100644 --- a/megalinter/descriptors/sql.megalinter-descriptor.yml +++ b/megalinter/descriptors/sql.megalinter-descriptor.yml @@ -82,7 +82,7 @@ linters: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" - RUN dotnet tool install --global TSQLLint ide: diff --git a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml index 27f02d984e1..973218a56ad 100644 --- a/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml +++ b/megalinter/descriptors/vbdotnet.megalinter-descriptor.yml @@ -19,7 +19,7 @@ install: - | RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 7.0 -version latest + && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 6.0 -version latest - ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" linters: # DOTNET FORMAT From 7f206ca1252bc053f6af607dc5bcfb429e10f7ee Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 5 Jan 2023 22:45:30 -0300 Subject: [PATCH 76/76] Updating changelog, removed 'list_of_files' for now --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f77149468..4cb7185e84a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Fix perl linter skipping files -- Upgrade to dotnet 6.0 + `list_of_files` for dotnet-format CLI lint mode to improve performances (requires `.csproj` or `.vbproj` in the repo) +- Upgrade to dotnet 6.0, dotnet-format requires `.sln`, `.csproj` or `.vbproj` in the repo - Linter versions upgrades - [csharpier](https://csharpier.com/) from 0.21.0 to **0.16.0** on 2022-12-29