chavacava
cfd69439bb
feature: new rule enforce-switch-default ( #1390 )
2025-06-01 09:57:47 +02:00
chavacava
6becd540e4
feature: new rule use-fmt-print ( #1389 )
...
print and println built-in functions are not recommended for use-cases other than language boostraping and are not guaranteed to stay in the language.
This commit adds a new rule, use-fmt-print, that spots uses of print and println, and recommends using their fmt equivalents.
v1.10.0
2025-05-28 12:57:37 +02:00
chavacava
a260ed9034
refactor: simplifies the implementation of rule call-to-gc ( #1388 )
2025-05-27 18:08:33 +02:00
ccoVeille
50dddb405b
feature: detect time/date out of bounds in time-date rule ( #1370 )
...
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com >
2025-05-27 03:25:01 -07:00
Oleksandr Redko
bbcfa7f7ae
docs: make contributors section shorter ( #1381 )
2025-05-27 02:26:46 -07:00
Oleksandr Redko
f4976873e7
docs: improve comments for functions; enable godot ( #1382 )
2025-05-27 07:44:24 +02:00
ccoVeille
398f7a83eb
chore: enforce American English spelling in golangci-lint ( #1384 )
2025-05-27 07:43:06 +02:00
ccoVeille
fb7687352c
chore: enable dupword linter in golangci-lint ( #1385 )
...
There is no errors right now, but it could avoid future issues.
2025-05-27 07:42:31 +02:00
ccoVeille
a3338de10b
chore: enable thelper linter in golangci-lint ( #1386 )
...
It allows us to report errors at the right place in the tests.
There was only one function that was not using the helper.
It has been fixed to use it.
2025-05-27 07:41:11 +02:00
ccoVeille
b1c9032746
feature: Add nil timezone handling detection to time-date rule ( #1377 )
2025-05-26 14:32:55 +02:00
chavacava
92f28cb5e1
refactor: moves code related to AST from rule.utils into astutils package ( #1380 )
...
Modifications summary:
* Moves AST-related functions from rule/utils.go to astutils/ast_utils.go (+ modifies function calls)
* Renames some of these AST-related functions
* Avoids instantiating a printer config at each call to astutils.GoFmt
* Uses astutils.IsIdent and astutils.IsPkgDotName when possible
2025-05-26 13:18:38 +02:00
Oleksandr Redko
87b146c60e
refactor: gofmt testdata ( #1379 )
2025-05-26 03:54:46 -07:00
Oleksandr Redko
e8ed573739
refactor: enable gocritic linter; fix lint issues ( #1375 )
2025-05-26 02:40:17 -07:00
chavacava
51ac5c2524
feature: new rule unnecessary-format to spot unnecessary use of formatting functions ( #1372 )
2025-05-26 11:07:42 +02:00
ccoVeille
ab05438914
chore: improve time-date decimal tests ( #1378 )
...
We want to ensure that the decimal literal are also detected in
functions, and not just at the package level.
This is a safeguard against future changes.
2025-05-26 09:54:33 +02:00
ccoVeille
a4737e935a
fix: avoid false positive for blank identifier ( #1376 )
...
The fact that the error variable is not used is out of the scope of the rule
This pattern that can be found in benchmarks and examples.
It should be allowed.
2025-05-25 17:36:22 +03:00
Oleksandr Redko
a56cf7290e
docs: format code snippets in markdown files ( #1324 )
2025-05-24 12:29:40 -07:00
chavacava
7b38dd84f1
refactor: modifies test utils functions by removing redundant test instructions parsing and simplifying asserting functions
2025-05-24 19:05:19 +02:00
chavacava
94cd7bdec2
refactor: removes get from getters names ( #1373 )
2025-05-24 19:03:05 +02:00
chavacava
f531af3b48
fix( #1363 ): package-comments ignores //nolint directives ( #1366 )
2025-05-23 14:07:38 +02:00
ccoVeille
3cac850cb6
feature: add rule time-date to check for time.Date usage ( #1327 )
...
This commit introduces a new rule to check for the usage of time.Date
The rule is added to report the usage of time.Date with non-decimal literals
Here the leading zeros that seems OK, forces the value to be octal literals.
time.Date(2023, 01, 02, 03, 04, 05, 06, time.UTC)
gofumpt formats the code like this when it encounters leading zeroes.
time.Date(2023, 0o1, 0o2, 0o3, 0o4, 0o5, 0o6, time.UTC)
The rule reports anything that is not a decimal literal.
2025-05-22 21:44:04 +02:00
chavacava
c73f766ea3
fix( #1367 ): struct-tag with validate is missing built-in rules
2025-05-22 20:53:10 +02:00
Oleksandr Redko
70c77d5be2
chore: add linter for Markdown files ( #1361 )
2025-05-21 22:00:07 +02:00
Hazhir Derakhshi
3f2cbe9d4b
fix: update rule description URLs to point to revive.run ( #1360 )
2025-05-20 09:26:22 +02:00
renovate[bot]
1c13e455be
fix(deps): update module github.com/mgechev/dots to v1.0.0 ( #1358 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com >
2025-05-19 09:29:04 -07:00
chavacava
e16f5aa5a6
refactor: tiny refactoring on friendly, sarif and stylish formatters ( #1355 )
...
* refactor: replace function call by var ref and move def near utilization in friendly and stylish formatters
* refactor: makes reduces visibility of Sarif.AddResult function by renaming it as addResult
* fix: stylish formatter doesn't handle singular/plural in the synthesis message
2025-05-18 10:52:49 +02:00
Hazhir Derakhshi
f3f77bb387
refactor: remove tablewriter dependency ( #1351 )
...
* Rewrite Friendly.table method to replace tablewriter with fmt.Fprintf
* Refactor Stylish formatter to use custom table rendering instead of tablewriter
* Refactor Friendly and Stylish formatters to utilize a new custom table rendering function
* Remove unused dependencies from go.mod and go.sum
* Refactor table formatting by replacing formatTable with a new table function in friendly.go
* Utilize text/tabwriter in fromatting a table
* Refactor table function to use bytes.Buffer for improved performance
2025-05-17 19:33:14 +02:00
Oleksandr Redko
254bb41730
chore: remove unused deploy key ( #1352 )
2025-05-16 14:41:54 +02:00
Arjun Rajpal
26125211ba
Integrate golangci-lint into CI/CD pipeline ( #1346 )
...
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com >
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com >
2025-05-16 05:12:23 -07:00
Oleksandr Redko
da3ba31922
docs: fix displaying rules table on revive.run ( #1349 )
2025-05-15 12:21:36 -07:00
Maria Ines Parnisari
f6cc22de4d
update garif ( #1340 )
2025-05-08 10:19:22 +02:00
renovate[bot]
5c4ed0917b
fix(deps): update module golang.org/x/tools to v0.33.0 ( #1339 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 17:42:24 -07:00
renovate[bot]
9f0dedcc82
chore(deps): update module golang.org/x/text to v0.25.0 ( #1338 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 17:38:40 -07:00
renovate[bot]
0fd7f16a68
chore(deps): update module golang.org/x/sys to v0.33.0 ( #1336 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 12:01:51 -07:00
renovate[bot]
a94da3b667
fix(deps): update module golang.org/x/sync to v0.14.0 ( #1337 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 12:01:33 -07:00
Oleksandr Redko
724a4ca419
chore: remove redundant //revive:disable-line ( #1335 )
2025-05-02 02:02:31 -07:00
Oleksandr Redko
48c047b4fb
chore: avoid third-party morphy2k/revive-action in CI ( #1334 )
2025-05-02 02:00:30 -07:00
Oleksandr Redko
906dcefddb
chore: remove redundant typeparams for Go 1.17 ( #1331 )
2025-05-01 02:44:38 -07:00
Oleksandr Redko
a5e5d78760
chore: enable a few revive rules ( #1330 )
2025-05-01 02:40:29 -07:00
chavacava
dbcfd66945
fix(1323): false positive in get-return rule for HTTP Get handlers ( #1325 )
2025-04-27 13:06:29 +02:00
Marcin Federowicz
7ba6ad4fcd
var-naming: remove regex from code ( #1322 )
...
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com >
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com >
2025-04-25 01:32:03 -07:00
chavacava
d8a47ba18e
var-name checks each package name only once ( #1319 )
2025-04-24 14:29:39 +02:00
Oleksandr Redko
17527c928b
docs: adapt golangci-lint configuration to v2 ( #1318 )
2025-04-17 01:40:28 -07:00
Oleksandr Redko
558580268e
var-naming: detect meaningless package names ( #1312 )
2025-04-16 02:30:28 -07:00
Ludovic Fernandez
57ed899d0c
fix: add missing TypeCheck call ( #1308 )
v1.9.0
2025-04-10 07:57:56 +02:00
Oleksandr Redko
7b2c7e74fc
test: split TestGetVersion; remove toolchain ( #1303 )
2025-04-10 07:54:40 +02:00
Oleksandr Redko
1cb97fdcfc
refactor: fix typos in comments and struct names ( #1304 )
2025-04-10 07:47:55 +02:00
Ludovic Fernandez
8221f8516d
chore: remove edited trigger ( #1309 )
2025-04-10 07:47:02 +02:00
Ludovic Fernandez
fbd90be544
fix: race condition of Package fields ( #1307 )
2025-04-10 07:44:38 +02:00
chavacava
f0eea95daf
struct-tag: change reported messages and refactor implementation ( #1292 )
2025-04-10 07:43:35 +02:00