Skip to content
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

Prepare linter for golangci-lint #5

Merged
merged 5 commits into from
Nov 19, 2023
Merged

Prepare linter for golangci-lint #5

merged 5 commits into from
Nov 19, 2023

Conversation

maranqz
Copy link
Owner

@maranqz maranqz commented Nov 15, 2023

Based on golangci/golangci-lint#4196 (review)

  1. TestdataDir() -> analysistest.TestData()
  2. Described False-Negative cases as testcases and in README.md
  3. Fixed link for type_nested.go.skip in README.md
  4. Added testcase with generic
  5. Added testcase with alias
  6. Added testcase with map, chan, array, func.

2. Described False-Negative cases as testcases and in README.md
3. Fixed link for type_nested.go.skip in README.md
4. Added testcase with generic
5. Added testcase with alias
6. Added testcase with map, chan, array, func
@maranqz
Copy link
Owner Author

maranqz commented Nov 15, 2023

@Antonboom I fixed all except

type OtherStruct struct {}

type Struct struct {
	Other OtherStruct 
}

func NewStruct() Struct {
	return Struct{
		Other: OtherStruct{}, // warning?
	}
}

I described this in README.md (Possible Features).
I would prefer to implement this feature on Winter weekends)

I added testcases
golangci-lint-pr...local-feature#diff-0f6b1de310c9ebd11cd754597d700529f0e1573f447aa9873263990f663ba7c3

README.md Outdated
@@ -18,8 +18,8 @@ Installation

### Options

- `-b`, `--blockedPkgs` - list of packages, where the structures should be created by factories. By default, all structures in all packages should be created by factories, [tests](testdata/src/factory/blockedPkgs).
- `-ob`, `onlyBlockedPkgs` - only blocked packages should use factory to initiate struct, [tests](testdata/src/factory/onlyBlockedPkgs).
- `-pg`, `--pkgGlobs` - list of glob packages, which can contain factories for structures in prefix. By default, all structures in all packages should be created by factories, [tests](testdata/src/factory/pkgGlobs).
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump major version for linter

2. Renamed options
@maranqz maranqz merged commit 5f8864e into main Nov 19, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant