-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TT-11627] Migrate failling to golangci-lint/forbidigo, fix issues #6152
[TT-11627] Migrate failling to golangci-lint/forbidigo, fix issues #6152
Conversation
API Changes no api changes detected |
PR Description updated to latest commit (16d6713) |
PR Review
Code feedback:
✨ Review tool usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-statediff --git a/dlpython/main_test.go b/dlpython/main_test.go
index 338c4b3..3550025 100644
--- a/dlpython/main_test.go
+++ b/dlpython/main_test.go
@@ -3,8 +3,6 @@ package python
import (
"os"
"testing"
-
- log "github.com/sirupsen/logrus"
)
var testVersion = "3.5" Please look at the run or in the Checks tab. |
Quality Gate passedIssues Measures |
1 similar comment
Quality Gate passedIssues Measures |
/release to release-5-lts |
Working on it! Note that it can take a few minutes. |
…6152) Tests only changes. https://tyktech.atlassian.net/browse/TT-11627 ___ enhancement, tests ___ - Migrated from `faillint` to `golangci-lint/forbidigo` and fixed issues by replacing `fmt.Printf` with `t.Logf` in various test files for better logging practices. - Added error handling for `json.MarshalIndent` in `apidef/oas/root_test.go`. - Configured `forbidigo` linter to forbid `fmt.Print*` and top-level `net/http` package functions, enhancing code quality. - Removed `faillint` tool installation and usage from the Makefile, streamlining the linting process. ___ <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>linter_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in OAS Linter Tests</code> </dd></summary> <hr> apidef/oas/linter_test.go - Replaced `fmt.Printf` with `t.Logf` for error logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-b92239afd81e77a829fe7fe8410044dfd4dfda525d17dbf5f8811714a9c986d3">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>root_test.go</strong><dd><code>Improve Error Handling and Logging in OAS Root Tests</code> </dd></summary> <hr> apidef/oas/root_test.go <li>Added error handling for <code>json.MarshalIndent</code>.<br> <li> Replaced <code>fmt.Println</code> with <code>t.Logf</code> for logging in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-4d144465b7fabaf2db8915de1ce3b6ff8c91a93c62d614c38fa38bdae28e23a2">+4/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>main_test.go</strong><dd><code>Use t.Logf for Version Logging in Python Tests</code> </dd></summary> <hr> dlpython/main_test.go - Replaced `fmt.Printf` with `t.Logf` for version logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-f8e159e1152ee20ea353fb647d7a7344414006fbd259c4e7073b47c96e8745cb">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>host_checker_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in Gateway Host Checker Tests</code></dd></summary> <hr> gateway/host_checker_test.go - Replaced `fmt.Printf` with `t.Logf` for logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-cfc8f5368c14d8fa56d845b1250f465b78c8aa6bfc5b47d0a556d706fa6b8622">+2/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>custom_policies_test.go</strong><dd><code>Correct Test Metadata in Custom Policies Tests</code> </dd></summary> <hr> user/custom_policies_test.go <li>Replaced <code>fmt.Print</code> with <code>TestSessionState_SetCustomPolicies</code> in test <br>metadata.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-c7b1cd92c4c30590d5da9f0d601d6a4957bedded8680da8434c4b76be5a5ed4c">+1/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>.golangci.yml</strong><dd><code>Configure forbidigo Linter and Adjust Issue Handling</code> </dd></summary> <hr> .golangci.yml <li>Enabled <code>forbidigo</code> linter and configured it to forbid <code>fmt.Print*</code> and <br>top-level <code>net/http</code> package functions.<br> <li> Added rules to exclude <code>forbidigo</code> linter in the <code>cli</code> package and <br>adjusted issue handling settings.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-6179837f7df53a6f05c522b6b7bb566d484d5465d9894fb04910dd08bb40dcc9">+15/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>Makefile</strong><dd><code>Remove faillint Tool from Linting Process</code> </dd></summary> <hr> Makefile - Removed `faillint` tool installation and usage. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52">+0/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <tit@tyk.io> (cherry picked from commit 3c796bf)
@titpetric Succesfully merged PR |
…t/forbidigo, fix issues (#6152) (#6153) [TT-11627] Migrate failling to golangci-lint/forbidigo, fix issues (#6152) ## **User description** Tests only changes. https://tyktech.atlassian.net/browse/TT-11627 ___ ## **Type** enhancement, tests ___ ## **Description** - Migrated from `faillint` to `golangci-lint/forbidigo` and fixed issues by replacing `fmt.Printf` with `t.Logf` in various test files for better logging practices. - Added error handling for `json.MarshalIndent` in `apidef/oas/root_test.go`. - Configured `forbidigo` linter to forbid `fmt.Print*` and top-level `net/http` package functions, enhancing code quality. - Removed `faillint` tool installation and usage from the Makefile, streamlining the linting process. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>linter_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in OAS Linter Tests</code> </dd></summary> <hr> apidef/oas/linter_test.go - Replaced `fmt.Printf` with `t.Logf` for error logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-b92239afd81e77a829fe7fe8410044dfd4dfda525d17dbf5f8811714a9c986d3">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>root_test.go</strong><dd><code>Improve Error Handling and Logging in OAS Root Tests</code> </dd></summary> <hr> apidef/oas/root_test.go <li>Added error handling for <code>json.MarshalIndent</code>.<br> <li> Replaced <code>fmt.Println</code> with <code>t.Logf</code> for logging in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-4d144465b7fabaf2db8915de1ce3b6ff8c91a93c62d614c38fa38bdae28e23a2">+4/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>main_test.go</strong><dd><code>Use t.Logf for Version Logging in Python Tests</code> </dd></summary> <hr> dlpython/main_test.go - Replaced `fmt.Printf` with `t.Logf` for version logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-f8e159e1152ee20ea353fb647d7a7344414006fbd259c4e7073b47c96e8745cb">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>host_checker_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in Gateway Host Checker Tests</code></dd></summary> <hr> gateway/host_checker_test.go - Replaced `fmt.Printf` with `t.Logf` for logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-cfc8f5368c14d8fa56d845b1250f465b78c8aa6bfc5b47d0a556d706fa6b8622">+2/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>custom_policies_test.go</strong><dd><code>Correct Test Metadata in Custom Policies Tests</code> </dd></summary> <hr> user/custom_policies_test.go <li>Replaced <code>fmt.Print</code> with <code>TestSessionState_SetCustomPolicies</code> in test <br>metadata.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-c7b1cd92c4c30590d5da9f0d601d6a4957bedded8680da8434c4b76be5a5ed4c">+1/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>.golangci.yml</strong><dd><code>Configure forbidigo Linter and Adjust Issue Handling</code> </dd></summary> <hr> .golangci.yml <li>Enabled <code>forbidigo</code> linter and configured it to forbid <code>fmt.Print*</code> and <br>top-level <code>net/http</code> package functions.<br> <li> Added rules to exclude <code>forbidigo</code> linter in the <code>cli</code> package and <br>adjusted issue handling settings.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-6179837f7df53a6f05c522b6b7bb566d484d5465d9894fb04910dd08bb40dcc9">+15/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>Makefile</strong><dd><code>Remove faillint Tool from Linting Process</code> </dd></summary> <hr> Makefile - Removed `faillint` tool installation and usage. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52">+0/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <tit@tyk.io> [TT-11627]: https://tyktech.atlassian.net/browse/TT-11627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Tit Petric <tit.petric@monotek.net> Co-authored-by: Tit Petric <tit@tyk.io>
/release to release-5.3 |
Working on it! Note that it can take a few minutes. |
Still working... |
…6152) ## **User description** Tests only changes. https://tyktech.atlassian.net/browse/TT-11627 ___ ## **Type** enhancement, tests ___ ## **Description** - Migrated from `faillint` to `golangci-lint/forbidigo` and fixed issues by replacing `fmt.Printf` with `t.Logf` in various test files for better logging practices. - Added error handling for `json.MarshalIndent` in `apidef/oas/root_test.go`. - Configured `forbidigo` linter to forbid `fmt.Print*` and top-level `net/http` package functions, enhancing code quality. - Removed `faillint` tool installation and usage from the Makefile, streamlining the linting process. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>linter_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in OAS Linter Tests</code> </dd></summary> <hr> apidef/oas/linter_test.go - Replaced `fmt.Printf` with `t.Logf` for error logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-b92239afd81e77a829fe7fe8410044dfd4dfda525d17dbf5f8811714a9c986d3">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>root_test.go</strong><dd><code>Improve Error Handling and Logging in OAS Root Tests</code> </dd></summary> <hr> apidef/oas/root_test.go <li>Added error handling for <code>json.MarshalIndent</code>.<br> <li> Replaced <code>fmt.Println</code> with <code>t.Logf</code> for logging in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-4d144465b7fabaf2db8915de1ce3b6ff8c91a93c62d614c38fa38bdae28e23a2">+4/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>main_test.go</strong><dd><code>Use t.Logf for Version Logging in Python Tests</code> </dd></summary> <hr> dlpython/main_test.go - Replaced `fmt.Printf` with `t.Logf` for version logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-f8e159e1152ee20ea353fb647d7a7344414006fbd259c4e7073b47c96e8745cb">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>host_checker_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in Gateway Host Checker Tests</code></dd></summary> <hr> gateway/host_checker_test.go - Replaced `fmt.Printf` with `t.Logf` for logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-cfc8f5368c14d8fa56d845b1250f465b78c8aa6bfc5b47d0a556d706fa6b8622">+2/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>custom_policies_test.go</strong><dd><code>Correct Test Metadata in Custom Policies Tests</code> </dd></summary> <hr> user/custom_policies_test.go <li>Replaced <code>fmt.Print</code> with <code>TestSessionState_SetCustomPolicies</code> in test <br>metadata.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-c7b1cd92c4c30590d5da9f0d601d6a4957bedded8680da8434c4b76be5a5ed4c">+1/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>.golangci.yml</strong><dd><code>Configure forbidigo Linter and Adjust Issue Handling</code> </dd></summary> <hr> .golangci.yml <li>Enabled <code>forbidigo</code> linter and configured it to forbid <code>fmt.Print*</code> and <br>top-level <code>net/http</code> package functions.<br> <li> Added rules to exclude <code>forbidigo</code> linter in the <code>cli</code> package and <br>adjusted issue handling settings.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-6179837f7df53a6f05c522b6b7bb566d484d5465d9894fb04910dd08bb40dcc9">+15/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>Makefile</strong><dd><code>Remove faillint Tool from Linting Process</code> </dd></summary> <hr> Makefile - Removed `faillint` tool installation and usage. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52">+0/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <tit@tyk.io> (cherry picked from commit 3c796bf)
…forbidigo, fix issues (#6152) [TT-11627] Migrate failling to golangci-lint/forbidigo, fix issues (#6152) ## **User description** Tests only changes. https://tyktech.atlassian.net/browse/TT-11627 ___ ## **Type** enhancement, tests ___ ## **Description** - Migrated from `faillint` to `golangci-lint/forbidigo` and fixed issues by replacing `fmt.Printf` with `t.Logf` in various test files for better logging practices. - Added error handling for `json.MarshalIndent` in `apidef/oas/root_test.go`. - Configured `forbidigo` linter to forbid `fmt.Print*` and top-level `net/http` package functions, enhancing code quality. - Removed `faillint` tool installation and usage from the Makefile, streamlining the linting process. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>linter_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in OAS Linter Tests</code> </dd></summary> <hr> apidef/oas/linter_test.go - Replaced `fmt.Printf` with `t.Logf` for error logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-b92239afd81e77a829fe7fe8410044dfd4dfda525d17dbf5f8811714a9c986d3">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>root_test.go</strong><dd><code>Improve Error Handling and Logging in OAS Root Tests</code> </dd></summary> <hr> apidef/oas/root_test.go <li>Added error handling for <code>json.MarshalIndent</code>.<br> <li> Replaced <code>fmt.Println</code> with <code>t.Logf</code> for logging in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-4d144465b7fabaf2db8915de1ce3b6ff8c91a93c62d614c38fa38bdae28e23a2">+4/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>main_test.go</strong><dd><code>Use t.Logf for Version Logging in Python Tests</code> </dd></summary> <hr> dlpython/main_test.go - Replaced `fmt.Printf` with `t.Logf` for version logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-f8e159e1152ee20ea353fb647d7a7344414006fbd259c4e7073b47c96e8745cb">+1/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>host_checker_test.go</strong><dd><code>Replace fmt.Printf with t.Logf in Gateway Host Checker Tests</code></dd></summary> <hr> gateway/host_checker_test.go - Replaced `fmt.Printf` with `t.Logf` for logging in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-cfc8f5368c14d8fa56d845b1250f465b78c8aa6bfc5b47d0a556d706fa6b8622">+2/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>custom_policies_test.go</strong><dd><code>Correct Test Metadata in Custom Policies Tests</code> </dd></summary> <hr> user/custom_policies_test.go <li>Replaced <code>fmt.Print</code> with <code>TestSessionState_SetCustomPolicies</code> in test <br>metadata.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-c7b1cd92c4c30590d5da9f0d601d6a4957bedded8680da8434c4b76be5a5ed4c">+1/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>.golangci.yml</strong><dd><code>Configure forbidigo Linter and Adjust Issue Handling</code> </dd></summary> <hr> .golangci.yml <li>Enabled <code>forbidigo</code> linter and configured it to forbid <code>fmt.Print*</code> and <br>top-level <code>net/http</code> package functions.<br> <li> Added rules to exclude <code>forbidigo</code> linter in the <code>cli</code> package and <br>adjusted issue handling settings.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-6179837f7df53a6f05c522b6b7bb566d484d5465d9894fb04910dd08bb40dcc9">+15/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>Makefile</strong><dd><code>Remove faillint Tool from Linting Process</code> </dd></summary> <hr> Makefile - Removed `faillint` tool installation and usage. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6152/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52">+0/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <tit@tyk.io>
@titpetric Succesfully merged PR |
User description
Tests only changes.
https://tyktech.atlassian.net/browse/TT-11627
Type
enhancement, tests
Description
faillint
togolangci-lint/forbidigo
and fixed issues by replacingfmt.Printf
witht.Logf
in various test files for better logging practices.json.MarshalIndent
inapidef/oas/root_test.go
.forbidigo
linter to forbidfmt.Print*
and top-levelnet/http
package functions, enhancing code quality.faillint
tool installation and usage from the Makefile, streamlining the linting process.Changes walkthrough
linter_test.go
Replace fmt.Printf with t.Logf in OAS Linter Tests
apidef/oas/linter_test.go
fmt.Printf
witht.Logf
for error logging in tests.root_test.go
Improve Error Handling and Logging in OAS Root Tests
apidef/oas/root_test.go
json.MarshalIndent
.fmt.Println
witht.Logf
for logging in tests.main_test.go
Use t.Logf for Version Logging in Python Tests
dlpython/main_test.go
fmt.Printf
witht.Logf
for version logging in tests.host_checker_test.go
Replace fmt.Printf with t.Logf in Gateway Host Checker Tests
gateway/host_checker_test.go
fmt.Printf
witht.Logf
for logging in tests.custom_policies_test.go
Correct Test Metadata in Custom Policies Tests
user/custom_policies_test.go
fmt.Print
withTestSessionState_SetCustomPolicies
in testmetadata.
.golangci.yml
Configure forbidigo Linter and Adjust Issue Handling
.golangci.yml
forbidigo
linter and configured it to forbidfmt.Print*
andtop-level
net/http
package functions.forbidigo
linter in thecli
package andadjusted issue handling settings.
Makefile
Remove faillint Tool from Linting Process
Makefile
faillint
tool installation and usage.