mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 09:15:26 +01:00 
			
		
		
		
	Update Vendors (#250)
update go min version Update Vendors: * code.gitea.io/gitea-vet v0.2.0 -> v0.2.1 * code.gitea.io/sdk/gitea v0.13.0 -> v0.13.1 * github.com/AlecAivazis/survey v2.1.1 -> v2.2.2 * github.com/adrg/xdg v0.2.1 -> v0.2.2 * github.com/araddon/dateparse d820a6159ab1 -> 8aadafed4dc4 * github.com/go-git/go-git v5.1.0 -> v5.2.0 * github.com/muesli/termenv v0.7.2 -> v0.7.4 * github.com/stretchr/testify v1.5.1 -> v1.6.1 * github.com/urfave/cli v2.2.0 -> v2.3.0 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/250 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: mrsdizzie <info@mrsdizzie.com> Co-Authored-By: 6543 <6543@noreply.gitea.io> Co-Committed-By: 6543 <6543@noreply.gitea.io>
This commit is contained in:
		
							
								
								
									
										5
									
								
								vendor/code.gitea.io/gitea-vet/CHANGELOG.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/code.gitea.io/gitea-vet/CHANGELOG.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,3 +1,8 @@ | ||||
| ## [v0.2.1](https://gitea.com/gitea/gitea-vet/releases/tag/v0.2.1) - 2020-08-15 | ||||
|  | ||||
| * BUGFIXES | ||||
|   * Split migration check to Deps and Imports (#9) | ||||
|  | ||||
| ## [0.2.0](https://gitea.com/gitea/gitea-vet/pulls?q=&type=all&state=closed&milestone=1272) - 2020-07-20 | ||||
|  | ||||
| * FEATURES | ||||
|   | ||||
							
								
								
									
										30
									
								
								vendor/code.gitea.io/gitea-vet/checks/migrations.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								vendor/code.gitea.io/gitea-vet/checks/migrations.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -18,10 +18,14 @@ var Migrations = &analysis.Analyzer{ | ||||
| 	Run:  checkMigrations, | ||||
| } | ||||
|  | ||||
| var migrationBlacklist = []string{ | ||||
| 	"code.gitea.io/gitea/models", | ||||
| 	"code.gitea.io/gitea/modules/structs", | ||||
| } | ||||
| var ( | ||||
| 	migrationDepBlockList = []string{ | ||||
| 		"code.gitea.io/gitea/models", | ||||
| 	} | ||||
| 	migrationImpBlockList = []string{ | ||||
| 		"code.gitea.io/gitea/modules/structs", | ||||
| 	} | ||||
| ) | ||||
|  | ||||
| func checkMigrations(pass *analysis.Pass) (interface{}, error) { | ||||
| 	if !strings.EqualFold(pass.Pkg.Path(), "code.gitea.io/gitea/models/migrations") { | ||||
| @@ -40,8 +44,22 @@ func checkMigrations(pass *analysis.Pass) (interface{}, error) { | ||||
|  | ||||
| 	deps := strings.Split(string(depsOut), "\n") | ||||
| 	for _, dep := range deps { | ||||
| 		if stringInSlice(dep, migrationBlacklist) { | ||||
| 			pass.Reportf(0, "code.gitea.io/gitea/models/migrations cannot depend on the following packages: %s", migrationBlacklist) | ||||
| 		if stringInSlice(dep, migrationDepBlockList) { | ||||
| 			pass.Reportf(0, "code.gitea.io/gitea/models/migrations cannot depend on the following packages: %s", migrationDepBlockList) | ||||
| 			return nil, nil | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	impsCmd := exec.Command("go", "list", "-f", `{{join .Imports "\n"}}`, "code.gitea.io/gitea/models/migrations") | ||||
| 	impsOut, err := impsCmd.Output() | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	imps := strings.Split(string(impsOut), "\n") | ||||
| 	for _, imp := range imps { | ||||
| 		if stringInSlice(imp, migrationImpBlockList) { | ||||
| 			pass.Reportf(0, "code.gitea.io/gitea/models/migrations cannot import the following packages: %s", migrationImpBlockList) | ||||
| 			return nil, nil | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 6543
					6543