1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-27 22:18:41 +02:00
Commit Graph

37 Commits

Author SHA1 Message Date
ccoVeille
40a690dff5 exported: improve detection and error message (#1403) 2025-07-22 01:47:37 -07:00
Oleksandr Redko
04983a692f exported: ignore exported symbols from the main package (#1398) 2025-06-16 14:23:47 +02:00
Oleksandr Redko
f4976873e7 docs: improve comments for functions; enable godot (#1382) 2025-05-27 07:44:24 +02:00
chavacava
343da9fbf2 Refactor/exported (#1299)
* simplify comment analysis by just checking the first comment line with documentation information

* nit refactorings: common func for adding failures, reduce the use of "stutter", and other nitties

* removes use of "stutter" in test code

* move string interpolation into addFailuref
2025-04-07 20:59:55 +02:00
Semih Buyukgungor
c882cb8f4f exported: correctly report deprecation-only comments (#1295) 2025-04-06 12:59:04 +02:00
Oleksandr Redko
9f5f957b33 rule: allow lowercased and kebab-cased options (#1272)
* rule: tests for Configure with named options; fix errors

* rule: refactor and add tests for ifelse rules

* rule: allow lowercased and kebab-cased options

* test: update integration tests with lowercased params

* docs: update rules descriptions

* rule: simplify Configure implementation with one option

* gofmt and fix lint

* review: add isRuleOption, update grammar in doc, simplify regex

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>

---------

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
2025-03-28 09:34:20 +01:00
ccoVeille
8cb2599624 fix: invalid message reported for directive comment (#1209)
They were invalid but not reported with the correct message.

So they were wrongly caught by golangci-lint that excluded them by default.
2025-01-27 07:12:16 +01:00
Oleksandr Redko
395f7902d3 refactor: replace failure Category raw string with constant (#1196)
* refactor: replace Category raw strings with constants

* Add type FailureCategory; add comments for constants
2025-01-18 12:16:19 +01:00
ccoVeille
3d1115dacd refactor: rule configuration and error management (#1185)
* refactor: avoid running rule once configuration failed

* refactor: remove deep-exit in lint/linter.go
2024-12-13 21:38:46 +01:00
Marcin Federowicz
9b15f3fcb6 refactor: replace panic with error in rules (#1126)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2024-12-11 19:35:58 +01:00
Oleksandr Redko
d181862481 docs: fix rule descriptions (#1147) 2024-12-01 16:44:41 +01:00
Oleksandr Redko
0e8acea6ce refactor: move functions out from utils.go (#1139) 2024-11-19 13:58:14 -08:00
Oleksandr Redko
1425e2f44c refactor: simplify with strings.Prefix, strings.CutPrefix (#1137) 2024-11-19 15:43:04 +01:00
Oleksandr Redko
0afba4ff15 refactor: enforce map and slice style (#1131) 2024-11-16 18:05:30 +01:00
Oleksandr Redko
3378f7033b refactor: replace mutex with sync.Once for rule configuration (#1118) 2024-11-15 12:03:59 +01:00
Marcin Federowicz
ff7b0adb4c rule.exported: add feature to disable checking on const,method,function, variable (#1047)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-10-02 10:46:52 +02:00
chavacava
798ce21849 makes exported rule behave as golint (#1051)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-09-29 22:50:49 +02:00
Oleksandr Redko
8bea739f45 docs: fix typo in comments (#1037) 2024-09-14 21:38:06 +02:00
Fagim Sadykov
8f9edc9fe7 #1002 - add "checkPublicInterface" option to "exported" rule to allow check documentation on public methods on public interfaces (#1003)
* [var-naming] handle private uppercased const

* FEATURE #1002 - "checkPublicInterface" option for "exported" rule - to check public interface method comments

* fix exported #1002 for ast.Ident

* fix exported #1002 for ast.Ident 2

* go fmt applyed

* #1002 update documentation on `exported` rule

* refactor `exported` rule configuration logic

* test and review fixes

---------

Co-authored-by: fregin <freginpanklinshtern@gmail.com>
2024-07-30 10:36:03 +02:00
chavacava
2aac974b5c fix issue #691 (#700) 2022-06-28 18:14:26 +03:00
Ivan Trubach
dc30eb1182 fix(receiver-naming): distinguish types with parameters (#692)
* fix(receiver-naming): distinguish types with parameters

* chore: run tests using supported Go versions matrix
2022-06-18 18:47:53 +02:00
chavacava
04728cf0de Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
chavacava
31fbdb1833 Fix/677 (#678) 2022-04-10 09:06:59 +02:00
chavacava
5ce2ff53c0 removes duplicated utility function (#652) 2022-03-18 15:00:41 +01:00
subham sarkar
577441d60c format sources w/ gofumpt (#643)
Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>
2022-03-02 08:24:55 +01:00
SalvadorC
2c895fb33f Code cleanup (#606) 2021-10-23 13:25:41 +02:00
SalvadorC
76b8c57329 Memoization of rule arguments (#595) 2021-10-17 20:34:48 +02:00
SalvadorC
18cdb55850 Exported config (#565)
* working version

* adds flag for replacing "stutters"
2021-08-26 08:36:24 -07:00
SalvadorC
84deee4163 fixes issue #229 (#231) 2019-09-10 10:26:47 -07:00
mgechev
376425d517 refactor: remove URL field from the failure struct 2018-10-30 15:37:27 -07:00
SalvadorC
388baa3eeb Fix linter warnings (recommended config) in the code (#71) 2018-09-22 15:27:22 -07:00
Minko Gechev
f966283f3e Fix rule for documentation of exported types (#29)
* Fix rule for documentation of exported types

The rule was failing in the following case:

```go
// A is an awesome type
type A = int
```

Because revive was skipping the leading `A`, considering it as an article.

* Add "This" article and update Makefile
2018-07-08 08:14:15 +10:00
mgechev
deb72d6238 Add default formatter 2018-01-27 17:01:18 -08:00
mgechev
f926547659 Refactoring 2018-01-24 15:44:03 -08:00
mgechev
cc249b6cfa Add extra rule 2018-01-23 23:01:49 -08:00
mgechev
1dc6e7cabd Remove useless getter 2018-01-21 18:48:51 -08:00
mgechev
98dce265c6 Refactoring 2018-01-21 18:04:41 -08:00