Commit Graph

20 Commits

Author SHA1 Message Date
yp05327 621ce6ac7b Add migration count check (#27)
Add checks for no matching of migration functions count and the length of `migrations` defined in `migrations.go`

For example, for `v284 -> v285`
![image](/attachments/e43c465e-d41f-4755-950d-d3565690ea2a)
remove line 556:
![image](/attachments/a8598239-f123-415a-8090-3bdb781ce6ab)
run `make lint-go-vet`:
![image](/attachments/7a55b7be-6c19-41b5-995f-98d4aa5a7100)

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/27
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
2024-01-23 02:36:32 +00:00
techknowlogick 54da2444a7 switch to actions (#26)
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/26
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-committed-by: techknowlogick <techknowlogick@gitea.io>
2023-04-19 23:03:51 +08:00
Jason Song 2b1561217f Remove DenylistImports (#23)
`DenylistImports` will be redundant once [gitea/pull/22412](https://github.com/go-gitea/gitea/pull/22412) has been merged.

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/23
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-committed-by: Jason Song <i@wolfogre.com>
2023-01-13 10:24:36 +08:00
Jason Song 7a42a3666a Changelog v0.2.2 (#22)
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/22
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Xinyu Zhou <i@sourcehut.net>
Co-authored-by: Jason Song <wolfogre@noreply.gitea.io>
Co-committed-by: Jason Song <wolfogre@noreply.gitea.io>
2022-12-02 11:52:05 +08:00
Jason Song 4c10dca949 Check SPDX-License-Identifier (#21)
Check `SPDX-License-Identifier` in file headers.

Related to https://github.com/go-gitea/gitea/pull/21840

Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/21
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Xinyu Zhou <i@sourcehut.net>
Co-authored-by: Jason Song <wolfogre@noreply.gitea.io>
Co-committed-by: Jason Song <wolfogre@noreply.gitea.io>
2022-12-01 23:58:05 +08:00
Gusted 854133ff01 Add gitea's go-crypto fork to deny list (#19)
- It's dangerous to use this fork over the official one. This one only
will contain changes to the SSH part of x/crypto in order to fix some
bugs. See https://github.com/go-gitea/gitea/pull/18711.

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/19
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-03-14 08:35:26 +08:00
Gusted 48ebc90254 Add "encoding/json" to denylist (#18)
- "encoding/json" should be avoided as we got a json module for that which get the correct json library when specified.
- Allow to exemptions to the denylist (e.g. the json module need to import this package).

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/18
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-01-22 23:17:48 +08:00
Gusted 791434a6a7 Add denylist import (#17)
- As per https://github.com/go-gitea/gitea/pull/18222#issuecomment-1008386067

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/17
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-01-11 09:43:43 +08:00
Andrew Thornton 7c98703580 If you open a session either return it or close it (#16)
If you call `sess := x.NewSession()` you must call `sess.Close()` or return the session.

This is not quite completely perfect for example if you return the output of x.NewSession() immediately it will falsely claim that you're not closing it. However it shows the beginnings of how to do it.

Signed-off-by: Andrew Thornton <art27@cantab.net>

close #15

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/16
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
2021-04-13 06:12:04 +08:00
techknowlogick ce29c2c254 Don't import git on models (#12)
Update 'checks/models.go'

Don't import git on models

Fix  #11

Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/12
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-19 15:26:56 +00:00
6543 1fdd6f8a0a Changelog v0.2.1 (#10)
Changelog v0.2.1

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/10
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: jaqra <jaqra@noreply.gitea.io>
2020-08-15 13:27:32 +00:00
6543 5233fe7746 Split migration check to Deps and Imports (#9)
Relax restrictions on modules/structs to disallow direct import of structs but allow dependency.

As discussed in https://github.com/go-gitea/gitea/pull/12282#issuecomment-664049963

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/9
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-08-15 09:18:23 +00:00
6543 900a9f5eac Changelog 0.2.0 (#7)
add Changelog for v0.2.0

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/7
2020-07-20 13:45:04 +00:00
6543 4787511f0b Correct Import Paths (#6)
fix import path after repo move

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/6
2020-07-20 13:29:15 +00:00
John Olheiser 29eb4b7ae5 Add migrations check (#5)
Update README

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Add copyright

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Add migrations check

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-vet/pulls/5
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-31 18:38:55 +00:00
John Olheiser 0185062ee4 Add CI (#1)
Add basic build when merged to master

Add basic CI compliance and linting

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/jolheiser/gitea-vet/pulls/1
2020-04-04 21:12:39 +00:00
jolheiser 6c7b81d401
Move checks to common package and add Makefile
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-04-03 22:28:55 -05:00
jolheiser 23910383a6
Change other to include any path with a "."
stdlib doesn't have any periods in their paths (as far as I know)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-24 23:04:52 -05:00
jolheiser d1cfced920
Fix import sorting and add README
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-24 22:56:58 -05:00
jolheiser 92e361fc3d
Initial commit
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-03-24 22:43:07 -05:00