Nanguan Lin
6a725b6f9c
Remove deadcode under models/issues ( #28536 )
...
Using the Go Official tool `golang.org/x/tools/cmd/deadcode@latest`
mentioned by [go blog](https://go.dev/blog/deadcode ).
Just use `deadcode .` in the project root folder and it gives a list of
unused functions. Though it has some false alarms.
This PR removes dead code detected in `models/issues`.
2023-12-19 20:12:02 +01:00
JakobDev
cc5df26680
Even more `db.DefaultContext` refactor ( #27352 )
...
Part of #27065
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2023-10-03 10:30:41 +00:00
KN4CK3R
f1173d6879
Use more specific test methods ( #24265 )
...
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-04-22 17:56:27 -04:00
wxiaoguang
cfe3d6e9b5
Make more functions use ctx instead of db.DefaultContext ( #24068 )
...
Continue the "ctx refactoring" work.
There are still a lot db.DefaultContext, incorrect context could cause
database deadlock errors.
2023-04-14 14:18:28 -04:00
Lunny Xiao
0a7d3ff786
refactor some functions to support ctx as first parameter ( #21878 )
...
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-12-03 10:48:26 +08:00
flynnnnnnnnnn
e81ccc406b
Implement FSFE REUSE for golang files ( #21840 )
...
Change all license headers to comply with REUSE specification.
Fix #16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2022-11-27 18:20:29 +00:00
Lunny Xiao
1a9821f57a
Move issues related files into models/issues ( #19931 )
...
* Move access and repo permission to models/perm/access
* fix test
* fix git test
* Move functions sequence
* Some improvements per @KN4CK3R and @delvh
* Move issues related code to models/issues
* Move some issues related sub package
* Merge
* Fix test
* Fix test
* Fix test
* Fix test
* Rename some files
2022-06-13 17:37:59 +08:00
Lunny Xiao
fd7d83ace6
Move almost all functions' parameter db.Engine to context.Context ( #19748 )
...
* Move almost all functions' parameter db.Engine to context.Context
* remove some unnecessary wrap functions
2022-05-20 22:08:52 +08:00
Lunny Xiao
a666829a37
Move user related model into models/user ( #17781 )
...
* Move user related model into models/user
* Fix lint for windows
* Fix windows lint
* Fix windows lint
* Move some tests in models
* Merge
2021-11-24 17:49:20 +08:00
wxiaoguang
750a8465f5
A better go code formatter, and now `make fmt` can run in Windows ( #17684 )
...
* go build / format tools
* re-format imports
2021-11-17 20:34:35 +08:00
wxiaoguang
df64fa4865
Decouple unit test code from business code ( #17623 )
2021-11-12 22:36:47 +08:00
Lunny Xiao
a4bfef265d
Move db related basic functions to models/db ( #17075 )
...
* Move db related basic functions to models/db
* Fix lint
* Fix lint
* Fix test
* Fix lint
* Fix lint
* revert unnecessary change
* Fix test
* Fix wrong replace string
* Use *Context
* Correct committer spelling and fix wrong replaced words
Co-authored-by: zeripath <art27@cantab.net>
2021-09-19 19:49:59 +08:00
KN4CK3R
3607f79d78
Fixed assert statements. ( #16089 )
2021-06-07 07:27:09 +02:00
Lunny Xiao
495d5e4329
Move more issue assignee code from models to issue service ( #8690 )
...
* Move more issue assignee code from models to issue service
* fix test
2019-10-28 10:11:50 +08:00