Merge branch 'master' into generics
This commit is contained in:
		
						commit
						ded38c5174
					
				
							
								
								
									
										25
									
								
								.github/workflows/golangci-lint.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.github/workflows/golangci-lint.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | ||||
| name: golangci-lint | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - master | ||||
|   pull_request: | ||||
| 
 | ||||
| permissions: | ||||
|   contents: read | ||||
|   pull-requests: read | ||||
| 
 | ||||
| jobs: | ||||
|   golangci: | ||||
|     name: lint | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|       - uses: actions/setup-go@v5 | ||||
|         with: | ||||
|           go-version: stable | ||||
|       - name: golangci-lint | ||||
|         uses: golangci/golangci-lint-action@v7 | ||||
|         with: | ||||
|           version: v2.0 | ||||
							
								
								
									
										22
									
								
								.github/workflows/reviewdog.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								.github/workflows/reviewdog.yml
									
									
									
									
										vendored
									
									
								
							| @ -1,22 +0,0 @@ | ||||
| name: reviewdog | ||||
| on: [pull_request] | ||||
| jobs: | ||||
|   golangci-lint: | ||||
|     name: runner / golangci-lint | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Check out code into the Go module directory | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: golangci-lint | ||||
|         uses: reviewdog/action-golangci-lint@v2 | ||||
| 
 | ||||
|       - name: Setup reviewdog | ||||
|         uses: reviewdog/action-setup@v1 | ||||
| 
 | ||||
|       - name: gofumpt -s with reviewdog | ||||
|         env: | ||||
|           REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
|         run: | | ||||
|           go install mvdan.cc/gofumpt@v0.2.0 | ||||
|           gofumpt -e -d . | \ | ||||
|           reviewdog -name="gofumpt" -f=diff -f.diff.strip=0 -reporter=github-pr-review | ||||
| @ -1,7 +1,9 @@ | ||||
| version: "2" | ||||
| 
 | ||||
| linters: | ||||
|   default: standard | ||||
|   enable: | ||||
|     - cyclop | ||||
|     - exportloopref | ||||
|     - gocritic | ||||
|     - gosec | ||||
|     - ineffassign | ||||
| @ -9,12 +11,9 @@ linters: | ||||
|     - prealloc | ||||
|     - unconvert | ||||
|     - unparam | ||||
|     - goimports | ||||
|     - whitespace | ||||
| 
 | ||||
| linters-settings: | ||||
|   whitespace: | ||||
|     multi-func: true | ||||
|   goimports: | ||||
|     local-prefixes: gorm.io/gorm | ||||
| 
 | ||||
| formatters: | ||||
|   enable: | ||||
|     - gofumpt | ||||
|     - goimports | ||||
|  | ||||
| @ -122,7 +122,7 @@ func parseFieldIndexes(field *Field) (indexes []Index, err error) { | ||||
| 					if composite, found := settings[key]; found { | ||||
| 						if len(composite) == 0 || composite == key { | ||||
| 							err = fmt.Errorf( | ||||
| 								"The composite tag of %s.%s cannot be empty", | ||||
| 								"the composite tag of %s.%s cannot be empty", | ||||
| 								field.Schema.Name, | ||||
| 								field.Name) | ||||
| 							return | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinzhu
						Jinzhu