Skip to content

Format files #13698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{go,tmpl,html}]
[*.{go, tmpl, html}]
indent_style = tab

[Makefile]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ all: build
.PHONY: help
help:
@echo "Make Routines:"
@echo " - \"\" equivalent to \"build\""
@echo " - \"\" equivalent to \"build\""
@echo " - build build everything"
@echo " - frontend build frontend files"
@echo " - backend build backend files"
Expand Down Expand Up @@ -180,7 +180,7 @@ help:
@echo " - revive run revive linter"
@echo " - misspell check for misspellings"
@echo " - vet examines Go source code and reports suspicious constructs"
@echo " - test[\#TestSpecificName] run unit test"
@echo " - test[\#TestSpecificName] run unit test"
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
@echo " - pr#<index> build and start gitea from a PR with integration test data loaded"

Expand Down
4 changes: 2 additions & 2 deletions build/update-locales.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ sed -i -r -e '/^[a-zA-Z0-9_.-]+[ ]*=[ ]*".*"$/ {
}' ./options/locale/*.ini

# Remove translation under 25% of en_us
baselines=`wc -l "./options/locale_en-US.ini" | cut -d" " -f1`
baselines=$(wc -l "./options/locale_en-US.ini" | cut -d" " -f1)
baselines=$((baselines / 4))
for filename in ./options/locale/*.ini; do
lines=`wc -l "$filename" | cut -d" " -f1`
lines=$(wc -l "$filename" | cut -d" " -f1)
if [ $lines -lt $baselines ]; then
echo "Removing $filename: $lines/$baselines"
rm "$filename"
Expand Down
58 changes: 29 additions & 29 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SCRIPT_TYPE = bash
; If the charsets have equal confidence, tie-breaking will be done by order in this list
; with charsets earlier in the list chosen in preference to those later.
; Adding "defaults" will place the unused charsets at that position.
DETECTED_CHARSETS_ORDER=UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr
DETECTED_CHARSETS_ORDER = UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr
; Default ANSI charset to override non-UTF-8 charsets to
ANSI_CHARSET =
; Force every new repository to be private
Expand Down Expand Up @@ -65,11 +65,11 @@ PREFIX_ARCHIVE_FILES = true
; Disable the creation of new mirrors. Pre-existing mirrors remain valid.
DISABLE_MIRRORS = false
; The default branch name of new repositories
DEFAULT_BRANCH=master
DEFAULT_BRANCH = master
; Allow adoption of unadopted repositories
ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES=false
ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES = false
; Allow deletion of unadopted repositories
ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES=false
ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES = false

[repository.editor]
; List of file extensions for which lines should be wrapped in the Monaco editor
Expand Down Expand Up @@ -97,25 +97,25 @@ MAX_FILES = 5

[repository.pull-request]
; List of prefixes used in Pull Request title to mark them as Work In Progress
WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP]
WORK_IN_PROGRESS_PREFIXES = WIP:,[WIP]
; List of keywords used in Pull Request comments to automatically close a related issue
CLOSE_KEYWORDS=close,closes,closed,fix,fixes,fixed,resolve,resolves,resolved
CLOSE_KEYWORDS = close,closes,closed,fix,fixes,fixed,resolve,resolves,resolved
; List of keywords used in Pull Request comments to automatically reopen a related issue
REOPEN_KEYWORDS=reopen,reopens,reopened
REOPEN_KEYWORDS = reopen,reopens,reopened
; In the default merge message for squash commits include at most this many commits
DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT=50
DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT = 50
; In the default merge message for squash commits limit the size of the commit messages to this
DEFAULT_MERGE_MESSAGE_SIZE=5120
DEFAULT_MERGE_MESSAGE_SIZE = 5120
; In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list
DEFAULT_MERGE_MESSAGE_ALL_AUTHORS=false
DEFAULT_MERGE_MESSAGE_ALL_AUTHORS = false
; In default merge messages limit the number of approvers listed as Reviewed-by: to this many
DEFAULT_MERGE_MESSAGE_MAX_APPROVERS=10
DEFAULT_MERGE_MESSAGE_MAX_APPROVERS = 10
; In default merge messages only include approvers who are official
DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY=true
DEFAULT_MERGE_MESSAGE_OFFICIAL_APPROVERS_ONLY = true

[repository.issue]
; List of reasons why a Pull Request or Issue can be locked
LOCK_REASONS=Too heated,Off-topic,Resolved,Spam
LOCK_REASONS = Too heated,Off-topic,Resolved,Spam

[repository.release]
; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
Expand All @@ -133,7 +133,7 @@ SIGNING_KEY = default
SIGNING_NAME =
SIGNING_EMAIL =
; Sets the default trust model for repositories. Options are: collaborator, committer, collaboratorcommitter
DEFAULT_TRUST_MODEL=collaborator
DEFAULT_TRUST_MODEL = collaborator
; Determines when gitea should sign the initial commit when creating a repository
; Either:
; - never
Expand All @@ -158,19 +158,19 @@ MERGES = pubkey, twofa, basesigned, commitssigned
[cors]
; More information about CORS can be found here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers
; enable cors headers (disabled by default)
ENABLED=false
ENABLED = false
; scheme of allowed requests
SCHEME=http
SCHEME = http
; list of requesting domains that are allowed
ALLOW_DOMAIN=*
ALLOW_DOMAIN = *
; allow subdomains of headers listed above to request
ALLOW_SUBDOMAIN=false
ALLOW_SUBDOMAIN = false
; list of methods allowed to request
METHODS=GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
; max time to cache response
MAX_AGE=10m
MAX_AGE = 10m
; allow request with credentials
ALLOW_CREDENTIALS=false
ALLOW_CREDENTIALS = false

[ui]
; Number of repositories that are displayed on one explore page
Expand Down Expand Up @@ -456,7 +456,7 @@ ISSUE_INDEXER_QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
ISSUE_INDEXER_QUEUE_BATCH_NUMBER = 20
; Timeout the indexer if it takes longer than this to start.
; Set to zero to disable timeout.
STARTUP_TIMEOUT=30s
STARTUP_TIMEOUT = 30s

; repo indexer by default disabled, since it uses a lot of disk space
REPO_INDEXER_ENABLED = false
Expand Down Expand Up @@ -597,7 +597,7 @@ RESET_PASSWD_CODE_LIVE_MINUTES = 180
REGISTER_EMAIL_CONFIRM = false
; List of domain names that are allowed to be used to register on a Gitea instance
; gitea.io,example.com
EMAIL_DOMAIN_WHITELIST=
EMAIL_DOMAIN_WHITELIST =
; Disallow registration, only allow admins to create accounts.
DISABLE_REGISTRATION = false
; Allow registration only using third-party services, it works only when DISABLE_REGISTRATION is false
Expand All @@ -620,7 +620,7 @@ ENABLE_CAPTCHA = false
CAPTCHA_TYPE = image
; Enable recaptcha to use Google's recaptcha service
; Go to https://www.google.com/recaptcha/admin to sign up for a key
RECAPTCHA_SECRET =
RECAPTCHA_SECRET =
RECAPTCHA_SITEKEY =
; For hCaptcha, create an account at https://accounts.hcaptcha.com/login to get your keys
HCAPTCHA_SECRET =
Expand Down Expand Up @@ -1117,15 +1117,15 @@ DEFAULT_MAX_BLOB_SIZE = 10485760
; Enables OAuth2 provider
ENABLE = true
; Lifetime of an OAuth2 access token in seconds
ACCESS_TOKEN_EXPIRATION_TIME=3600
ACCESS_TOKEN_EXPIRATION_TIME = 3600
; Lifetime of an OAuth2 refresh token in hours
REFRESH_TOKEN_EXPIRATION_TIME=730
REFRESH_TOKEN_EXPIRATION_TIME = 730
; Check if refresh token got already used
INVALIDATE_REFRESH_TOKENS=false
INVALIDATE_REFRESH_TOKENS = false
; OAuth2 authentication secret for access and refresh tokens, change this yourself to a unique string. CLI generate option is helpful in this case. https://docs.gitea.io/en-us/command-line/#generate
JWT_SECRET=
JWT_SECRET =
; Maximum length of oauth2 token/cookie stored on server
MAX_TOKEN_LENGTH=32767
MAX_TOKEN_LENGTH = 32767

[i18n]
LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR
Expand Down
4 changes: 2 additions & 2 deletions docker/root/etc/s6/gitea/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
[[ -f ./setup ]] && source ./setup

pushd /app/gitea > /dev/null
exec su-exec $USER /app/gitea/gitea web
pushd /app/gitea >/dev/null
exec su-exec $USER /app/gitea/gitea web
popd
4 changes: 2 additions & 2 deletions docker/root/etc/s6/openssh/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
[[ -f ./setup ]] && source ./setup

pushd /root > /dev/null
exec su-exec root /usr/sbin/sshd -D -e 2>&1
pushd /root >/dev/null
exec su-exec root /usr/sbin/sshd -D -e 2>&1
popd
34 changes: 0 additions & 34 deletions docs/.editorconfig

This file was deleted.

12 changes: 6 additions & 6 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `SSH_PORT`: **22**: SSH port displayed in clone URL.
- `SSH_LISTEN_HOST`: **0.0.0.0**: Listen address for the built-in SSH server.
- `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
- `SSH_ROOT_PATH`: **~/.ssh**: Root path of SSH directory.
- `SSH_ROOT_PATH`: **~/.ssh**: Root path of SSH directory.
- `SSH_CREATE_AUTHORIZED_KEYS_FILE`: **true**: Gitea will create a authorized_keys file by default when it is not using the internal ssh server. If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
- `SSH_AUTHORIZED_KEYS_BACKUP`: **true**: Enable SSH Authorized Key Backup when rewriting all keys, default is true.
- `SSH_TRUSTED_USER_CA_KEYS`: **\<empty\>**: Specifies the public keys of certificate authorities that are trusted to sign user certificates for authentication. Multiple keys should be comma separated. E.g.`ssh-<algorithm> <key>` or `ssh-<algorithm> <key1>, ssh-<algorithm> <key2>`. For more information see `TrustedUserCAKeys` in the sshd config man pages. When empty no file will be created and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` will default to `off`.
Expand Down Expand Up @@ -294,7 +294,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `USER`: **root**: Database username.
- `PASSWD`: **\<empty\>**: Database user password. Use \`your password\` or """your password""" for quoting if you use special characters in the password.
- `SCHEMA`: **\<empty\>**: For PostgreSQL only, schema to use if different from "public". The schema must exist beforehand,
the user must have creation privileges on it, and the user search path must be set to the look into the schema first
the user must have creation privileges on it, and the user search path must be set to the look into the schema first
(e.g. `ALTER USER user SET SEARCH_PATH = schema_name,"$user",public;`).
- `SSL_MODE`: **disable**: SSL/TLS encryption mode for connecting to the database. This option is only applied for PostgreSQL and MySQL.
- Valid values for MySQL:
Expand All @@ -318,7 +318,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `MAX_OPEN_CONNS` **0**: Database maximum open connections - default is 0, meaning there is no limit.
- `MAX_IDLE_CONNS` **2**: Max idle database connections on connnection pool, default is 2 - this will be capped to `MAX_OPEN_CONNS`.
- `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071).

Please see #8540 & #8273 for further discussion of the appropriate values for `MAX_OPEN_CONNS`, `MAX_IDLE_CONNS` & `CONN_MAX_LIFETIME` and their
relation to port exhaustion.

Expand Down Expand Up @@ -465,7 +465,7 @@ relation to port exhaustion.
- `DEFAULT_ORG_VISIBILITY`: **public**: Set default visibility mode for organisations, either "public", "limited" or "private".
- `DEFAULT_ORG_MEMBER_VISIBLE`: **false** True will make the membership of the users visible when added to the organisation.
- `ALLOW_ONLY_EXTERNAL_REGISTRATION`: **false** Set to true to force registration only using third-party services.
- `NO_REPLY_ADDRESS`: **DOMAIN** Default value for the domain part of the user's email address in the git log if he has set KeepEmailPrivate to true.
- `NO_REPLY_ADDRESS`: **DOMAIN** Default value for the domain part of the user's email address in the git log if he has set KeepEmailPrivate to true.
The user's email will be replaced with a concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS.

## SSH Minimum Key Sizes (`ssh.minimum_key_sizes`)
Expand Down Expand Up @@ -493,7 +493,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
- `HELO_HOSTNAME`: **\<empty\>**: Custom hostname for HELO operation.
- `HOST`: **\<empty\>**: SMTP mail host address and port (example: smtp.gitea.io:587).
- Using opportunistic TLS via STARTTLS on port 587 is recommended per RFC 6409.
- `IS_TLS_ENABLED` : **false** : Forcibly use TLS to connect even if not on a default SMTPS port.
- `IS_TLS_ENABLED` : **false** : Forcibly use TLS to connect even if not on a default SMTPS port.
- Note, if the port ends with `465` SMTPS/SMTP over TLS will be used despite this setting.
- Otherwise if `IS_TLS_ENABLED=false` and the server supports `STARTTLS` this will be used. Thus if `STARTTLS` is preferred you should set `IS_TLS_ENABLED=false`.
- `FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or
Expand Down Expand Up @@ -855,7 +855,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
## LFS (`lfs`)

Storage configuration for lfs data. It will be derived from default `[storage]` or
`[storage.xxx]` when set `STORAGE_TYPE` to `xxx`. When derived, the default of `PATH`
`[storage.xxx]` when set `STORAGE_TYPE` to `xxx`. When derived, the default of `PATH`
is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`.

- `STORAGE_TYPE`: **local**: Storage type for lfs, `local` for local disk or `minio` for s3 compatible object storage service or other name defined with `[storage.xxx]`
Expand Down
6 changes: 3 additions & 3 deletions docs/content/doc/advanced/external-renderers.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ menu:

# Custom files rendering configuration

Gitea supports custom file renderings (i.e., Jupyter notebooks, asciidoc, etc.) through external binaries,
Gitea supports custom file renderings (i.e., Jupyter notebooks, asciidoc, etc.) through external binaries,
it is just a matter of:

* installing external binaries
Expand All @@ -26,7 +26,7 @@ This supports rendering of whole files. If you want to render code blocks in mar

## Installing external binaries

In order to get file rendering through external binaries, their associated packages must be installed.
In order to get file rendering through external binaries, their associated packages must be installed.
If you're using a Docker image, your `Dockerfile` should contain something along this lines:

```
Expand All @@ -41,7 +41,7 @@ RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng libffi-d

RUN pip3 install --upgrade pip
RUN pip3 install -U setuptools
RUN pip3 install jupyter docutils
RUN pip3 install jupyter docutils
# add above any other python package you may need to install
```

Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/advanced/logging-documentation.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can configure the outputs of this logger by setting the `MODE`
value in the `[log]` section of the configuration.

Each output sublogger is configured in a separate `[log.sublogger.default]`
which inherits from the sublogger `[log.sublogger]` section and from the
which inherits from the sublogger `[log.sublogger]` section and from the
generic `[log]` section, but there are certain default values. These will
not be inherited from the `[log]` section:

Expand Down Expand Up @@ -361,7 +361,7 @@ If you are running on Unix you may wish to release-and-reopen logs in order to u
It is possible force gitea to release and reopen it's logging files and connections by sending `SIGUSR1` to the
running process, or running `gitea manager logging release-and-reopen`.

Alternatively, you may wish to pause and resume logging - this can be accomplished through the use of the
Alternatively, you may wish to pause and resume logging - this can be accomplished through the use of the
`gitea manager logging pause` and `gitea manager logging resume` commands. Please note that whilst logging
is paused log events below INFO level will not be stored and only a limited number of events will be stored.
Logging may block, albeit temporarily, slowing gitea considerably whilst paused - therefore it is
Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/advanced/mail-templates-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ This template produces something along these lines:
>
> Mike, I think we should tone down the blues a little.
> \__________________________________________________________________
>
>
> [View it on Gitea](#).

## Advanced
Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/advanced/make.fr-fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gitea fait largement usage de Make pour automatiser les tâches et avoir un dév

### Linux

Vous pouvez installer Make avec votre gestionnaire de paquetages
Vous pouvez installer Make avec votre gestionnaire de paquetages

Depuis Ubuntu/Debian:

Expand Down
2 changes: 0 additions & 2 deletions docs/content/doc/advanced/repo-indexer.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ Pattern matching works as follows:
* To match all files named `Makefile`, use `**Makefile`.
* Matching a directory has no effect; the pattern `resources/bin` will not include/exclude files inside that directory; `resources/bin/**` will.
* All files and patterns are normalized to lower case, so `**Makefile`, `**makefile` and `**MAKEFILE` are equivalent.


2 changes: 1 addition & 1 deletion docs/content/doc/developers/hacking-on-gitea.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ from within the `$GOPATH`, hence the `go get` approach is no longer recommended.

## Forking Gitea

Download the master Gitea source code as above. Then, fork the
Download the master Gitea source code as above. Then, fork the
[Gitea repository](https://github.com/go-gitea/gitea) on GitHub,
and either switch the git remote origin for your fork or add your fork as another remote:

Expand Down
8 changes: 4 additions & 4 deletions docs/content/doc/developers/integrations.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ menu:

# Integrations

Gitea has a wonderful community of third-party integrations, as well as first-class support in various other
Gitea has a wonderful community of third-party integrations, as well as first-class support in various other
projects.

We are curating a list over at [awesome-gitea](https://gitea.com/gitea/awesome-gitea) to track these!

If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#devops),
an [SDK](https://gitea.com/gitea/awesome-gitea#sdk),
or even some extra [themes](https://gitea.com/gitea/awesome-gitea#themes),
If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#devops),
an [SDK](https://gitea.com/gitea/awesome-gitea#sdk),
or even some extra [themes](https://gitea.com/gitea/awesome-gitea#themes),
you can find them listed in the [awesome-gitea](https://gitea.com/gitea/awesome-gitea) repository!
Loading