summaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Downgrade golangci-lint to 1.47.0 (#20445)silverwind2022-07-221-1/+1
| | | | | | | This should fix some recently seen linter performance issues. There is some log spam, but it's definitely faster. Ref: https://github.com/golangci/golangci-lint/issues/2997 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update all tool dependencies to their latest versions (#20409)silverwind2022-07-201-4/+4
|
* Fix eslint parsing errors, remove eslint-plugin-html (#20323)silverwind2022-07-151-1/+1
| | | | | | | | | | | Introduce a separate .eslintrc in the Vue components folder to selectively enable vue-eslint-parser there, so that the rest of the files can use eslint's core parser which can deal with hashbangs. The fact that the eslint-disable comments worked in HTML was a unintended side-effect of the files being parsed via vue-eslint-parser, so I had to disable the parsing of these files in .eslintrc.yaml to make it work, and finally decided to remove eslint-plugin-html as it causes more issues than it solves.
* Fix versions check for busybox `sh` (#20358)silverwind2022-07-141-3/+3
| | | | | | `printf` in busybox emits a ugly 'invalid number' error when formatting string variables are present. Avoid that by reducing the go version check to just two digits, which ought to be enough as patch-level go versions are meant to be compatible. Avoid error on node-check as well.
* Fix various typos (#20338)luzpaz2022-07-121-1/+1
| | | | | | | * Fix various typos Found via `codespell -q 3 -S ./options/locale,./options/license,./public/vendor -L actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon` Co-authored-by: zeripath <art27@cantab.net>
* Add spectral linter for Swagger (#20321)silverwind2022-07-111-0/+1
| | | | | | | | | | [spectral](https://github.com/stoplightio/spectral) lints openapi/swagger files for mistakes of which it has identified a few and which I've fixed. I had to put it into `lint-frontend` because it depends on node_modules so can not run on Drone during the backend target. I plan to refactor these targets later to `lint-js` and `lint-go` so that they are categorized based on the tool dependencies.
* Remove `GO111MODULE` (#20221)Gusted2022-07-041-4/+3
| | | | | - Given we use go1.18 for this and don't rely on the Go 1.11 modules behavior(we use the modern `go run` & `go get` which has the correct behavior by-default).
* Normalize line endings in fomantic build files (#19932)silverwind2022-06-101-0/+1
| | | | | | Ensures consistent line endings to avoid useless diffs because there is somthing platform-dependant in that build. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Modernize JS build scripts (#19824)silverwind2022-06-061-1/+1
| | | | | | | | | | - Remove __dirname, use file URLs instead - Upgrade fabric dependency - Use fs/promises syntax, this breaks node 12 but we require 14 already The change in public/img/favicon.svg is not caused by the fabric upgrade, but it seems it was not properly generated when introduced. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* fix(CI/CD): correct CI variable. (#19886)Bo-Yi Wu2022-06-051-4/+4
| | | | | | | | | default value is true for CI variable see https://docs.drone.io/pipeline/environment/reference/ci/ Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove customized (unmaintained) dropdown, improve aria a11y for dropdown ↵wxiaoguang2022-06-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#19861) * Remove customized (unmaintained) dropdown, improve aria a11y for dropdown * fix repo permission * use action instead of onChange * re-order the CSS selector * fix dropdown behavior for repo permissions, make elements inside menu item non-focusable * use menu/menuitem instead of combobox/option. use tooltip(data-content) for aria-label, prevent from repeated attaching * click menu item when pressing Enter * code format * fix repo permission * repo setting: prevent from misleading users when error occurs * fine tune the repo collaboration access mode dropdown (in case the access mode is undefined in the template) Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add 'make tidy' (#19800)silverwind2022-05-241-5/+10
| | | | | Convenience command to run 'go mod tidy'. The compat flag is set to the minimum supported go version instead of min version minus one which is go's default, which eliminated some checksums in go.sum as a result.
* Update go tool dependencies (#19676)silverwind2022-05-101-2/+2
| | | | | | | | | | | * Update go tool dependencies Updated all tool dependencies to latest tags, hoping CI will like it. * fix new lint errors * handle more strings.Title cases * remove lint skip
* add a directory prefix `gitea-src-VERSION` to release-tar-file (#19396)jklippel2022-04-261-1/+3
| | | | Use a directory prefix instead on creating the tar file. Fixes: #19066
* Check go and nodejs version by go.mod and package.json (#19197)gesangtome2022-03-261-5/+6
| | | | | | * Check go and nodejs version by go.mod and package.json * Update Go official site URL Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update tool dependencies (#19120)silverwind2022-03-181-4/+4
| | | | - Use tag over hash for all tool dependencies - Update them to latest released versions
* use go1.18 to build gitea (#19099)techknowlogick2022-03-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * use go1.18 to build gitea& update min go version to 1.17 * bump in a few more places * add a few simple tests for isipprivate * update go.mod * update URL to https://go.dev/dl/ * golangci-lint * attempt golangci-lint workaround * change version * bump fumpt version * skip strings.title test * go mod tidy * update tests as some aren't private?? * update tests
* Use `go run` for tool dependencies, require go 1.17 (#18874)silverwind2022-03-151-59/+41
| | | | | | | | | | This ensures the tools only run in the versions we've tested and it also does not polute PATH with those tools so they are truly isolated. This syntax of `go run` requires go 1.17, so the minimum version is set accordingly. Fixes: https://github.com/go-gitea/gitea/issues/18867 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Lock gofumpt to v0.3.0 and run it (#18866)silverwind2022-02-231-2/+2
| | | | | We can't depend on `latest` version of gofumpt because the output will not be stable across versions. Lock it down to the latest version released yesterday and run it again.
* Generate coverage with sqlite. (#18813)KN4CK3R2022-02-191-0/+7
|
* Move editorconfig-checker to lint-backend and remove JS wrapper (#18793)silverwind2022-02-181-2/+8
| | | | | | | | | * Move editorconfig-checker to lint-backend It makes more sense there as templates are considered backend code. * User golang version of the tool * remove dependency
* Increase the size of the webauthn_credential credential_id field (#18739)zeripath2022-02-131-0/+5
| | | | | | | | | | | Unfortunately credentialIDs in u2f are 255 bytes long which with base32 encoding becomes 408 bytes. The default size of a xorm string field is only a VARCHAR(255) This problem is not apparent on SQLite because strings get mapped to TEXT there. Fix #18727 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Reduce CI go module downloads, add make targets (#18708)silverwind2022-02-121-0/+13
| | | | | | | | | | | | | The CI currently downloads all go modules in each pipeline step because go modules reside outside the project directory. Fix this by introducing a volume for the `/go` directory [1] so modules are only downloaded once per pipeline using a new `deps-backend` make target. For completeness, I also included new `deps` and `deps-frontend` targets and the frontend one is also triggered explicitly on CI where needed. [1] https://docs.drone.io/pipeline/kubernetes/examples/language/golang/#dependencies
* Fix `make fmt` and `make fmt-check` (#18633)silverwind2022-02-061-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Run 'make fmt' 'make fmt' currently produces this change, I'm not sure how CI did not fail on it, I made sure I have `mvdan.cc/gofumpt@latest`. * Fix 'make fmt-check' `make fmt-check` did not run all commands that `make fmt` did, resulting in missed diffs. Fix that by just depending on the `fmt` target. Includes: https://github.com/go-gitea/gitea/pull/18633 * Make gitea-fmt work with -l and -d and integrate gofumpt This implements -l, -w and -d with gitea-fmt and merges gofumpt. Signed-off-by: Andrew Thornton <art27@cantab.net> * as per silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review * use -l instead of -d for fmt-check Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net>
* quote MAKE to prevent path expansion with space error (#18622)Kyle D2022-02-051-1/+1
| | | | | | | | | | | Pretty minor change to prevent error when `$(MAKE)` path is expanded with a space in the path. ```bash $ TAGS="bindata sqlite sqlite_unlock_notify" make build /usr/bin/sh: -c: line 0: syntax error near unexpected token `(' /usr/bin/sh: -c: line 0: `C:/Program Files (x86)/GnuWin32/bin/make -v | head -n 1' ``` I believe Program Files (x86) is the default path for GNU make on windows
* add gitea-fmt back (#18526)65432022-02-011-2/+5
|
* Bump golangci-lint version (#18411)Gusted2022-01-261-1/+1
| | | - Bump golangci-lint version to v1.44.0 (no new linter errors detected)
* format with gofumpt (#18184)65432022-01-201-2/+4
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* update description about vendoring in CONTRIBUTING.md (#18280)a10121127962022-01-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * update description about vendoring in CONTRIBUTING.md follow #18277 Signed-off-by: a1012112796 <1012112796@qq.com> * Update CONTRIBUTING.md Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> * fix and readd test-vendor step * remove vendor from .gitattributes @silverwind * simplify go mod check Signed-off-by: a1012112796 <1012112796@qq.com> * Revert "remove vendor from .gitattributes @silverwind" This reverts commit 4789e704cb7a2c80934e4a4cd31efb161e6c8666. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Add lockfile-check (#18285)silverwind2022-01-151-1/+12
| | | | | | | * Add lockfile-check This check runs `npm install` which will rewrite the lockfile in case it is inconsistent with package.json. This check detects this and will fail the CI in such a case.
* Remove golang vendored directory (#18277)techknowlogick2022-01-141-18/+18
| | | | | | | * rm go vendor * fix drone yaml * add to gitignore
* Fix documents for development and bug report (#18249)wxiaoguang2022-01-131-2/+2
|
* chore(lint): use golangci-lint to call revive and misspell checker. (#18145)Bo-Yi Wu2022-01-021-27/+2
| | | | | | replace revive and misspell with golangci-lint Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* Avoid running go vet twice (#18059)Gusted2021-12-211-1/+0
|
* Add new JS linter rules (#17699)silverwind2021-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | * Add new JS linter rules Adds a few useful rules from eslint-plugin-github. Notable changes: - Forbid dataset usage, its camel-casing behaviour makes it hard to grep for attributes. - Forbid .then() and .catch(), we should generally prefer await for new code. For rare cases where they are useful, a eslint-disable-line directive can be set. - Add docs js to linting * also enable github/array-foreach * small tweak Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* A better go code formatter, and now `make fmt` can run in Windows (#17684)wxiaoguang2021-11-171-8/+4
| | | | * go build / format tools * re-format imports
* Update golangci-lint in Makefile (#17647)Gusted2021-11-171-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | * Update golangci-lint in Makefile - Partially resolvess #17596 - Download specific version(v1.43.0) by default. - If current installed version is older than the minium version, it will download the mininium required version. - Update the install script to avoid deprecated error `golangci/golangci-lint err this script is deprecated, please do not use it anymore. check https://github.com/goreleaser/godownloader/issues/207` * Simplify golangci-lint version check * Fix version conversion * Add version that's downloading Co-authored-by: zeripath <art27@cantab.net> * Consistency Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Set unit test timeout to 20 minutes (#17664)Lunny Xiao2021-11-161-1/+1
| | | | | | | | | | * Set unit test timeout to 15 minutes * Update Makefile Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Rename .air.conf to .air.toml (#17360)silverwind2021-10-201-1/+1
| | | | As of https://github.com/cosmtrek/air/pull/90, the preferred file extension is .toml. The file format was always toml itself.
* Use go1.16+ way of installing binaries (#17342)techknowlogick2021-10-171-6/+6
|
* Workaround coverage bug part 2 (#16906)zeripath2021-08-311-2/+2
| | | | | | | | | | | * Workaround coverage bug part 2 Just grep away bad lines from coverage files. Signed-off-by: Andrew Thornton <art27@cantab.net> * try again Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent coverage break (#16887)zeripath2021-08-311-1/+3
| | | | | | | | | | | | | * Prevent coverage break There are repeated failures of our CI due to an intermittent issue with coverage.out finishing with a spurious `0` on a single line. This problem is very annoying and very hard to understand where it is coming from, therefore as the problem appears random and without clear cause we should just strip this line from our coverage. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Remove unused Fomantic sidebar module (#16853)silverwind2021-08-291-0/+1
| | | | | | | | | | | * Remove unused Fomantic sidebar module The [Sidebar](https://fomantic-ui.com/modules/sidebar.html) module seems currently unused (at least I can't find any reference to it in templates or js), so remove it from the Fomantic build. * remove useless minified fomantic build files * mark fomantic build files as being generated
* Enable race detector for CI (#1441)Mura Li2021-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Enable race detector by default Set RACE_ENABLED=0 to disable it when release * Disable race detector for release builds * use `true` * fix * debug issue * fix * verbose * clean * Fix wrong merge * Fix coverage merge Co-authored-by: Mura Li <typeless@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* build with go1.17 (#16707)techknowlogick2021-08-171-1/+1
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Restore Accessibility for Dropdown (#16576)zeripath2021-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Restore #10096/#8638 and re-fix #15172 This PR restores the vendored and patched dropdow from #8638. It however, abandons the calls to `click()` using instead the default dropdown click calls instead. This prevents the issue of the dropdown grabbing focus permanently however, this may have negative effects on the effect of focus on the dropdowns. Of note, the behaviour of the template selector dropdown on the repo creation page is slightly odd - I don't believe that this odd behaviour is caused by this PR but rather by the feed source for this. I suspect that the dropdown should be adding a delete button to its selection. Fix #15172 References: #7057 Signed-off-by: Andrew Thornton <art27@cantab.net> * leverage fomantic-build instead Signed-off-by: Andrew Thornton <art27@cantab.net> * as per jookia Signed-off-by: Andrew Thornton <art27@cantab.net>
* Upgrade to golang-jwt 3.2.2 (#16590)zeripath2021-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Upgrade to golang-jwt 3.2.2 Upgrade to the latest version of golang-jwt Signed-off-by: Andrew Thornton <art27@cantab.net> * Forcibly replace the 3.2.1 version of golang-jwt/jwt and increase minimum Go version Using go.mod we can forcibly replace the 3.2.1 version used by goth to 3.2.2. Further given golang-jwt/jwts stated policy of only supporting supported go versions we should just raise our minimal version of go to 1.16 for 1.16 as by time of release 1.15 will be out of support. Signed-off-by: Andrew Thornton <art27@cantab.net> * update minimal go required Signed-off-by: Andrew Thornton <art27@cantab.net> * update config.yaml Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Prevent race in TestPersistableChannelQueue (#16468)zeripath2021-07-171-2/+2
| | | | | | | | | | | | | * Prevent race in TestPersistableChannelQueue A slight race has become apparent in the TestPersistableChannelQueue. This PR simply adds locking to prevent the race. * make print value of "$(GOTESTFLAGS)" on test-backend and unit-test-coverage Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix source typos (#16374)luzpaz2021-07-081-1/+1
| | | | | | | | | | * Fix source typos Follow up to e0296b6a6 Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby` * rm "ignore destory on `make misspell-check`" Co-authored-by: 6543 <6543@obermui.de>
* use "true" for RACE_ENABLED (#15261)65432021-06-021-3/+4
|