Commit graph

17 commits

Author SHA1 Message Date
silverwind 72a3a6fde7
Add svg linter and fix incorrect svgs (#30086)
Fixes https://github.com/go-gitea/gitea/issues/30082.

Adds a new linter that searches for non-existant SVG images in
templates. Output before the fix was:

```
$ make lint-templates
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-markup" not found, used in templates/repo/diff/comment_form.tmpl
make: *** [Makefile:438: lint-templates] Error 1
```

<img width="306" alt="Screenshot 2024-03-25 at 23 31 05"
src="https://github.com/go-gitea/gitea/assets/115237/1052d1a9-bfec-4d5a-9cae-f895f78f7c93">

(cherry picked from commit 2ab5f05f40d93224f73e211e84de50a88a6ecf03)

Conflicts:
	.github/workflows/files-changed.yml
	.github/workflows/pull-compliance.yml
	do not exist in Forgejo and the Forgejo workflows
	already contain the changes
2024-03-30 07:17:30 +01:00
silverwind b96845ae01
Enforce trailing comma in JS on multiline (#30002)
To keep blame info accurate and to avoid [changes like
this](https://github.com/go-gitea/gitea/pull/29977/files#diff-c3422631a14edbe1e508c4b22f0c718db318be08a6e889427802f9b6165d88d6R359),
it's good to always have a trailing comma, so let's enforce it in JS.

This rule is completely automatically fixable with `make lint-js-fix`
and that's what I did here.

(cherry picked from commit 3d751b6ec18e57698ce86b79866031d2c80c2071)

Conflicts:
	web_src/js/components/DashboardRepoList.vue
	trivial context conflict because of '3b7b899afa fix commit_status'
2024-03-26 19:04:27 +01:00
silverwind 6eb576c36d
move some scripts from 'build' to 'tools' directory, misc refactors (#29844)
- Move some scripts from `build` to new `tools` dir. Eventually i would
like to move all but let's do it step-by-step.
- Add dir to eslint and move the files into vars.
- Update docs accordingly.
- While updating docs I noticed we were incorrectly having `public/img`
path still in a few places. Replace those with the current
`public/assets/img`.

---------

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 095fdd691dd1a7d7748372cc73e7708278c80933)
2024-03-26 19:04:25 +01:00
wxiaoguang 5b5f7b756b
Clean some legacy files and move some build files (#23699)
* Clean the "tools" directory. The "tools" directory contains only two
files, move them.
* The "external_renderer.go" works like "cat" command to echo Stdin to
Stdout , to help testing.
* The `// gobuild: external_renderer` is incorrect, there should be no
space: `//gobuild: external_renderer`
* The `fmt.Print(os.Args[1])` is not a well-defined behavior, and it's
never used.
* The "watch.sh" is for "make watch", it's somewhat related to "build"
* After this PR, there is no "tools" directory, the project root
directory looks slightly simpler than before.
* Remove the legacy "contrib/autoboot.sh", there is no
"gogs_supervisord.sh"
* Remove the legacy "contrib/mysql.sql", it's never mentioned anywhere.
* Remove the legacy "contrib/pr/checkout.go", it has been broken for
long time, and it introduces unnecessary dependencies of the main code
base.
2023-03-25 16:22:51 -04:00
Khaled Yakdan dbfc5aa016
Move fuzz tests into tests/fuzz (#22376)
This puts the fuzz tests in the same directory as other tests and eases
the integration in OSS-Fuzz

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-01-09 15:30:14 +08:00
AdamKorcz 906d8cc5dc
Rewrite fuzzers to native Go harnesses (#22313) 2023-01-05 10:33:00 +08:00
Lunny Xiao 36a2d2f919
Add a simple test for external renderer (#20033)
Fix #16402
2022-12-12 20:45:21 +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
wxiaoguang c18d8d6968
Remove legacy +build: constraint (#19582)
Go 1.17 and later use modern `//go:build` constraints, the old `// +build:` constraints should be removed.
2022-05-02 23:22:45 +08:00
6543 54e9ee37a7
format with gofumpt (#18184)
* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt
2022-01-20 18:46:10 +01:00
zeripath 5cb0c9aa0d
Propagate context and ensure git commands run in request context (#17868)
This PR continues the work in #17125 by progressively ensuring that git
commands run within the request context.

This now means that the if there is a git repo already open in the context it will be used instead of reopening it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-01-19 23:26:57 +00:00
John Olheiser 648464b504
Add bundle download for repository (#14538)
* Add bundle download

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

* Fix fmt

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

* Fix build tags

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

* Download specific commit

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2021-08-24 11:47:09 -05:00
zeripath 5fbccad906
Fix NPE in fuzzer (#16680)
The fuzzer found an issue with the issue pattern processor where there is a spurious
path.Clean which does not need to be there. This PR also sets the default AppURL for
the fuzzer too.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-13 00:22:05 +02:00
zeripath 1a1ce9b721
Fuzzer finds an NPE due to incorrect URLPrefix (#16249)
The Fuzzer is running on a non-repo urlprefix which is incorrect for RenderRaw

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

Co-authored-by: 6543 <6543@obermui.de>
2021-06-25 14:14:49 -04:00
6543 bee8ce342f
Fix go-fuzz (#15596)
* Fix go-fuzz

followup of https://github.com/go-gitea/gitea/pull/15175

* simplify

* enhance
2021-04-23 16:22:52 +08:00
AdamKorcz 94415f7517
Added 2 fuzzers (#13818)
* Added fuzzer

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Added better fuzzer names

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Moved fuzzer to /tools

* Update tools/fuzz.go

Co-authored-by: 6543 <6543@obermui.de>

* Update tools/fuzz.go

* Update tools/fuzz.go

Co-authored-by: silverwind <me@silverwind.io>

* Added tools to Makefile

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
2020-12-10 20:43:11 +01:00
silverwind e1535c74cc
Add 'make watch' (#12636)
* Add 'make watch'

This combines frontend and backend watch into a single command that runs
them in parallel on on SIGINT terminates both.

Termination is not super-clean but I guess it does not have to.

* move to tools/, trap more signals, remove gnu-specific flag

* simplify

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-09-04 20:55:06 -04:00