Pull request: all: reformat yaml, add yaml formatting standard

Merge in DNS/adguard-home from 2297-yaml to master

Closes #2297.

Squashed commit of the following:

commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Nov 20 17:52:22 2020 +0300

    all: improve HACKING.md

commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Nov 20 17:50:34 2020 +0300

    Merge branch 'master' into 2297-yaml

commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Nov 12 20:25:42 2020 +0300

    all: reformat yaml, add yaml formatting standard
This commit is contained in:
Ainar Garipov 2020-11-20 18:06:07 +03:00
parent 3045da1742
commit 046ec13fdc
8 changed files with 2427 additions and 2411 deletions

View File

@ -1,8 +1,8 @@
coverage:
status:
project:
default:
target: 40%
threshold: null
patch: false
changes: false
'coverage':
'status':
'project':
'default':
'target': '40%'
'threshold': null
'patch': false
'changes': false

32
.github/stale.yml vendored
View File

@ -1,19 +1,19 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- 'bug'
- 'enhancement'
- 'feature request'
- 'localization'
# Label to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
# Number of days of inactivity before an issue becomes stale.
'daysUntilStale': 60
# Number of days of inactivity before a stale issue is closed.
'daysUntilClose': 7
# Issues with these labels will never be considered stale.
'exemptLabels':
- 'bug'
- 'enhancement'
- 'feature request'
- 'localization'
# Label to use when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
# Comment to post when closing a stale issue. Set to `false` to disable.
'closeComment': false

View File

@ -1,170 +1,136 @@
name: build
'name': 'build'
env:
GO_VERSION: 1.14
NODE_VERSION: 13
'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13'
on:
push:
branches:
- '*'
tags:
- v*
pull_request:
'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request':
jobs:
'jobs':
'test':
'runs-on': '${{ matrix.os }}'
'env':
'GO111MODULE': 'on'
'GOPROXY': 'https://goproxy.io'
'strategy':
'fail-fast': false
'matrix':
'os':
- 'ubuntu-latest'
- 'macOS-latest'
- 'windows-latest'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'uses': 'actions/setup-go@v2'
'with':
'go-version': '${{ env.GO_VERSION }}'
- 'name': 'Set up Node'
'uses': 'actions/setup-node@v1'
'with':
'node-version': '${{ env.NODE_VERSION }}'
- 'name': 'Set up Go modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'uses': 'actions/setup-go@v2'
'with':
'go-version': '${{ env.GO_VERSION }}'
- 'name': 'Set up Node'
'uses': 'actions/setup-node@v1'
'with':
'node-version': '${{ env.NODE_VERSION }}'
- 'name': 'Set up Go modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
test:
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
GOPROXY: https://goproxy.io
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v1'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
-
name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Set up Go modules cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Run make ci
shell: bash
run: |
make ci
-
name: Upload coverage
uses: codecov/codecov-action@v1
if: success() && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
app:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
-
name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Set up Go modules cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up node_modules cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Set up Snapcraft
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
-
name: Set up GoReleaser
run: |
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
-
name: Run snapshot build
run: |
make release
docker:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Docker Buildx (build)
run: |
make docker-multi-arch
notify:
needs: [app, docker]
# Secrets are not passed to workflows that are triggered by a pull request from a fork
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
'notify':
'needs':
- 'app'
- 'docker'
# Secrets are not passed to workflows that are triggered by a pull request
# from a fork.
'if': "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}"
'runs-on': 'ubuntu-latest'
'steps':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}'

View File

@ -1,47 +1,46 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- '*'
pull_request:
jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2.3.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# Secrets are not passed to workflows that are triggered by a pull request from a fork
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
'name': 'golangci-lint'
'on':
'push':
'tags':
- 'v*'
'branches':
- '*'
'pull_request':
'jobs':
'golangci':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'golangci-lint'
'uses': 'golangci/golangci-lint-action@v2.3.0'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# Secrets are not passed to workflows that are triggered by a pull request
# from a fork.
'if': "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}"
'runs-on': 'ubuntu-latest'
'steps':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}'

View File

@ -1,78 +1,77 @@
# options for analysis running
run:
'run':
# default concurrency is a available CPU number
concurrency: 4
'concurrency': 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 2m
'deadline': '2m'
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- ".*generated.*"
- dnsfilter/rule_to_regexp.go
- util/pprof.go
- ".*_test.go"
- client/.*
- build/.*
- dist/.*
'skip-files':
- '.*generated.*'
- 'dnsfilter/rule_to_regexp.go'
- 'util/pprof.go'
- '.*_test.go'
- 'client/.*'
- 'build/.*'
- 'dist/.*'
# all available settings of specific linters
linters-settings:
errcheck:
'linters-settings':
'errcheck':
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,net:SetReadDeadline,net/http:^Write
gocyclo:
min-complexity: 20
lll:
line-length: 200
'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write'
'gocyclo':
'min-complexity': 20
'lll':
'line-length': 200
linters:
enable:
- deadcode
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- varcheck
- bodyclose
- depguard
- dupl
- gocyclo
- goimports
- golint
- gosec
- misspell
- stylecheck
- unconvert
disable-all: true
fast: true
'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true
issues:
'issues':
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
# structcheck cannot detect usages while they're there
- .parentalServer. is unused
- .safeBrowsingServer. is unused
# errcheck
- Error return value of .s.closeConn. is not checked
- Error return value of ..*.Shutdown.
# goconst
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
'exclude':
# structcheck cannot detect usages while they're there
- '.parentalServer. is unused'
- '.safeBrowsingServer. is unused'
# errcheck
- 'Error return value of .s.closeConn. is not checked'
- 'Error return value of ..*.Shutdown.'
# goconst
- 'string .forcesafesearch.google.com. has 3 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306'

View File

@ -1,106 +1,107 @@
project_name: AdGuardHome
'project_name': 'AdGuardHome'
env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io'
before:
hooks:
- go mod download
- go generate ./...
'before':
'hooks':
- 'go mod download'
- 'go generate ./...'
builds:
- main: ./main.go
ldflags:
- -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- freebsd
- windows
goarch:
- 386
- amd64
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
gomips:
- softfloat
ignore:
- goos: freebsd
goarch: mips
- goos: freebsd
goarch: mipsle
'builds':
- 'main': './main.go'
'ldflags':
- '-s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}'
'env':
- 'CGO_ENABLED=0'
'goos':
- 'darwin'
- 'linux'
- 'freebsd'
- 'windows'
'goarch':
- '386'
- 'amd64'
- 'arm'
- 'arm64'
- 'mips'
- 'mipsle'
- 'mips64'
- 'mips64le'
'goarm':
- '5'
- '6'
- '7'
'gomips':
- 'softfloat'
'ignore':
- 'goos': 'freebsd'
'goarch': 'mips'
- 'goos': 'freebsd'
'goarch': 'mipsle'
archives:
- # Archive name template.
# Defaults:
# - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
# - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
# - if format is `binary`:
# - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
wrap_in_directory: "AdGuardHome"
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
files:
- LICENSE.txt
- README.md
'archives':
- # Archive name template.
# Defaults:
# - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
# - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
# - if format is `binary`:
# - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
'name_template': '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
'wrap_in_directory': 'AdGuardHome'
'format_overrides':
- 'goos': 'windows'
'format': 'zip'
- 'goos': 'darwin'
'format': 'zip'
'files':
- 'LICENSE.txt'
- 'README.md'
snapcrafts:
- name: adguard-home
base: core18
name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
summary: Network-wide ads & trackers blocking DNS server
description: |
AdGuard Home is a network-wide software for blocking ads & tracking. After
you set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
'snapcrafts':
- 'name': 'adguard-home'
'base': 'core18'
'name_template': '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
'summary': 'Network-wide ads & trackers blocking DNS server'
'description': |
AdGuard Home is a network-wide software for blocking ads & tracking. After
you set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
It operates as a DNS server that re-routes tracking domains to a "black hole,"
thus preventing your devices from connecting to those servers. It's based
on software we use for our public AdGuard DNS servers -- both share a lot
of common code.
grade: stable
confinement: strict
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
It operates as a DNS server that re-routes tracking domains to a "black hole,"
thus preventing your devices from connecting to those servers. It's based
on software we use for our public AdGuard DNS servers -- both share a lot
of common code.
'grade': 'stable'
'confinement': 'strict'
'publish': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop'
checksum:
name_template: 'checksums.txt'
'checksum':
'name_template': 'checksums.txt'

View File

@ -1,9 +1,11 @@
# AdGuardHome Developer Guidelines
As of **2020-11-12**, this document is still a work-in-progress. Some of the
As of **2020-11-20**, this document is still a work-in-progress. Some of the
rules aren't enforced, and others might change. Still, this is a good place to
find out about how we **want** our code to look like.
The rules are mostly sorted in the alphabetical order.
## Git
* Follow the commit message header format:
@ -13,11 +15,14 @@ find out about how we **want** our code to look like.
```
Where `pkg` is the package where most changes took place. If there are
several such packages, just write `all`.
several such packages, or the change is top-level only, write `all`.
* Keep your commit messages to be no wider than eighty (**80**) columns.
* Keep your commit messages, including headers, to eighty (**80**) columns.
* Only use lowercase letters in your commit message headers.
* Only use lowercase letters in your commit message headers. The rest of the
message should follow the plain text conventions below.
The only exception are direct mentions of identifiers from the source code.
## Go
@ -98,8 +103,20 @@ find out about how we **want** our code to look like.
[constant errors]: https://dave.cheney.net/2016/04/07/constant-errors
[Linus said]: https://www.kernel.org/doc/html/v4.17/process/coding-style.html#indentation
## Markdown
* **TODO(a.garipov):** Define our Markdown conventions.
## Text, Including Comments
* End sentences with appropriate punctuation.
* Headers should be written with all initial letters capitalized, except for
references to variable names that start with a lowercase letter.
* Start sentences with a capital letter, unless the first word is a reference
to a variable name that starts with a lowercase letter.
* Text should wrap at eighty (**80**) columns to be more readable, to use
a common standard, and to allow editing or diffing side-by-side without
wrapping.
@ -126,17 +143,17 @@ find out about how we **want** our code to look like.
// TODO(usr1, usr2): Fix the frobulation issue.
```
## Markdown
* **TODO(a.garipov):** Define our Markdown conventions.
## YAML
* **TODO(a.garipov):** Define naming conventions for schema names in our
OpenAPI YAML file. And just generally OpenAPI conventions.
* **TODO(a.garipov):** Find a YAML formatter or write our own.
* All strings, including keys, must be quoted. Reason: the [NO-rway Law].
* Indent with two (**2**) spaces.
* Indent with two (**2**) spaces. YAML documents can get pretty
deeply-nested.
* No extra indentation in multiline arrays:
@ -147,7 +164,10 @@ find out about how we **want** our code to look like.
- 'value-3'
```
* Prefer single quotes for string to prevent accidental escaping, unless
escaping is required.
* Prefer single quotes for strings to prevent accidental escaping, unless
escaping is required or there are single quotes inside the string (e.g. for
*GitHub Actions*).
* Use `>` for multiline strings, unless you need to keep the line breaks.
[NO-rway Law]: https://news.ycombinator.com/item?id=17359376

File diff suppressed because it is too large Load Diff