Add yamllint

This commit is contained in:
Florian Bruhin 2020-07-23 11:21:04 +02:00
parent a9c8f9270b
commit 1daa863218
11 changed files with 217 additions and 144 deletions

View File

@ -1,7 +1,7 @@
coverage:
status:
project: off
patch: off
changes: off
project: false
patch: false
changes: false
comment: off
comment: false

View File

@ -23,6 +23,7 @@ jobs:
- testenv: eslint
- testenv: shellcheck
args: "-f gcc" # For problem matchers
- testenv: yamllint
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2

18
.yamllint Normal file
View File

@ -0,0 +1,18 @@
extends: default
ignore: |
/.venv/
/.tox/
/build/
/dist/
rules:
document-start: disable
line-length:
ignore: |
/.github/*.yml
/.github/workflows/*.yml
truthy:
# on: ...
ignore: |
/.github/workflows/*.yml

View File

@ -2119,7 +2119,8 @@ The following placeholders are defined:
with QtWebEngine).
* `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for QtWebEngine.
* `{qt_version}`: The underlying Qt version.
* `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for QtWebEngine.
* `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
QtWebEngine.
* `{upstream_browser_version}`: The corresponding Safari/Chrome version.
* `{qutebrowser_version}`: The currently running qutebrowser version.
@ -4021,7 +4022,8 @@ The following placeholders are defined:
* `{current_title}`: Title of the current web page.
* `{title_sep}`: The string ` - ` if a title is set, empty otherwise.
* `{index}`: Index of this tab.
* `{aligned_index}`: Index of this tab padded with spaces to have the same width.
* `{aligned_index}`: Index of this tab padded with spaces to have the same
width.
* `{id}`: Internal tab ID of this tab.
* `{scroll_pos}`: Page scroll position.
* `{host}`: Host of the current web page.

View File

@ -0,0 +1,5 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
pathspec==0.8.0
PyYAML==5.3.1
yamllint==1.24.2

View File

@ -0,0 +1 @@
yamllint

View File

@ -45,18 +45,20 @@ search.ignore_case:
search.incremental:
type: Bool
default: True
desc: Find text on a page incrementally, renewing the search for each typed character.
default: true
desc: >-
Find text on a page incrementally, renewing the search for each typed
character.
search.wrap:
type: Bool
default: True
default: true
backend:
QtWebEngine: Qt 5.14
QtWebKit: true
desc: >-
Wrap around at the top and bottom of the page when advancing through text matches
using `:search-next` and `:search-prev`.
Wrap around at the top and bottom of the page when advancing through text
matches using `:search-next` and `:search-prev`.
new_instance_open_target:
type:
@ -589,7 +591,8 @@ content.headers.user_agent:
with QtWebEngine).
* `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for QtWebEngine.
* `{qt_version}`: The underlying Qt version.
* `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for QtWebEngine.
* `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
QtWebEngine.
* `{upstream_browser_version}`: The corresponding Safari/Chrome version.
* `{qutebrowser_version}`: The currently running qutebrowser version.
@ -869,7 +872,7 @@ content.user_stylesheets:
type:
name: ListOrValue
valtype: File
none_ok: True
none_ok: true
default: []
desc: List of user stylesheet filenames to use.
@ -880,7 +883,6 @@ content.webgl:
desc: Enable WebGL.
content.webrtc_ip_handling_policy:
default: all-interfaces
type:
name: String
valid_values:
@ -1361,7 +1363,7 @@ hints.leave_on_load:
input.escape_quits_reporter:
type: Bool
default: True
default: true
desc: Allow Escape to quit the crash reporter.
input.forward_unbound_keys:
@ -1636,7 +1638,8 @@ statusbar.widgets:
- url: "Current page URL."
- scroll: "Percentage of the current page position like `10%`."
- scroll_raw: "Raw percentage of the current page position like `10`."
- history: "Display an arrow when possible to go back/forward in history."
- history: "Display an arrow when possible to go back/forward in
history."
- tabs: "Current active tab, e.g. `2`."
- keypress: "Display pressed keys when composing a vi command."
- progress: "Progress bar for the current page loading."
@ -1822,7 +1825,8 @@ tabs.title.format:
* `{current_title}`: Title of the current web page.
* `{title_sep}`: The string ` - ` if a title is set, empty otherwise.
* `{index}`: Index of this tab.
* `{aligned_index}`: Index of this tab padded with spaces to have the same width.
* `{aligned_index}`: Index of this tab padded with spaces to have the same
width.
* `{id}`: Internal tab ID of this tab.
* `{scroll_pos}`: Page scroll position.
* `{host}`: Host of the current web page.
@ -1874,11 +1878,13 @@ tabs.min_width:
minval: -1
maxval: maxint
desc: >-
Minimum width (in pixels) of tabs (-1 for the default minimum size behavior).
Minimum width (in pixels) of tabs (-1 for the default minimum size
behavior).
This setting only applies when tabs are horizontal.
This setting does not apply to pinned tabs, unless `tabs.pinned.shrink` is False.
This setting does not apply to pinned tabs, unless `tabs.pinned.shrink` is
False.
tabs.max_width:
default: -1
@ -1929,7 +1935,7 @@ tabs.pinned.shrink:
tabs.pinned.frozen:
type: Bool
default: True
default: true
desc: Force pinned tabs to stay at fixed URL.
tabs.undo_stack_size:
@ -1971,7 +1977,8 @@ url.auto_search:
- naive: Use simple/naive check.
- dns: Use DNS requests (might be slow!).
- never: Never search automatically.
- schemeless: Always search automatically unless URL explicitly contains a scheme.
- schemeless: Always search automatically unless URL explicitly contains
a scheme.
default: naive
desc: What search to start when something else than a URL is entered.
@ -1994,7 +2001,8 @@ url.incdec_segments:
url.open_base_url:
type: Bool
default: false
desc: Open base URL of the searchengine if a searchengine shortcut is invoked without parameters.
desc: Open base URL of the searchengine if a searchengine shortcut is invoked
without parameters.
url.searchengines:
default:
@ -2743,7 +2751,8 @@ colors.webpage.darkmode.policy.images:
WARNING: On Qt 5.15.0, this setting can cause frequent renderer process
crashes due to a
https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/304211[bug in Qt].
https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/304211[bug
in Qt].
restart: true
backend:
QtWebEngine: Qt 5.14
@ -2837,7 +2846,7 @@ fonts.default_family:
type:
name: ListOrValue
valtype: Font
none_ok: True
none_ok: true
desc: >-
Default font families to use.
@ -3214,10 +3223,14 @@ bindings.default:
gD: tab-give
q: record-macro
"@": run-macro
tsh: config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload
tSh: config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload
tsH: config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled ;; reload
tSH: config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload
tsh: config-cycle -p -t -u *://{url:host}/* content.javascript.enabled
;; reload
tSh: config-cycle -p -u *://{url:host}/* content.javascript.enabled
;; reload
tsH: config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled
;; reload
tSH: config-cycle -p -u *://*.{url:host}/* content.javascript.enabled
;; reload
tsu: config-cycle -p -t -u {url} content.javascript.enabled ;; reload
tSu: config-cycle -p -u {url} content.javascript.enabled ;; reload
tph: config-cycle -p -t -u *://{url:host}/* content.plugins ;; reload
@ -3232,12 +3245,18 @@ bindings.default:
tIH: config-cycle -p -u *://*.{url:host}/* content.images ;; reload
tiu: config-cycle -p -t -u {url} content.images ;; reload
tIu: config-cycle -p -u {url} content.images ;; reload
tch: config-cycle -p -t -u *://{url:host}/* content.cookies.accept all no-3rdparty never ;; reload
tCh: config-cycle -p -u *://{url:host}/* content.cookies.accept all no-3rdparty never ;; reload
tcH: config-cycle -p -t -u *://*.{url:host}/* content.cookies.accept all no-3rdparty never ;; reload
tCH: config-cycle -p -u *://*.{url:host}/* content.cookies.accept all no-3rdparty never ;; reload
tcu: config-cycle -p -t -u {url} content.cookies.accept all no-3rdparty never ;; reload
tCu: config-cycle -p -u {url} content.cookies.accept all no-3rdparty never ;; reload
tch: config-cycle -p -t -u *://{url:host}/* content.cookies.accept
all no-3rdparty never ;; reload
tCh: config-cycle -p -u *://{url:host}/* content.cookies.accept
all no-3rdparty never ;; reload
tcH: config-cycle -p -t -u *://*.{url:host}/* content.cookies.accept
all no-3rdparty never ;; reload
tCH: config-cycle -p -u *://*.{url:host}/* content.cookies.accept
all no-3rdparty never ;; reload
tcu: config-cycle -p -t -u {url} content.cookies.accept
all no-3rdparty never ;; reload
tCu: config-cycle -p -u {url} content.cookies.accept
all no-3rdparty never ;; reload
insert:
<Ctrl-E>: open-editor
<Shift-Ins>: insert-text -- {primary}

View File

@ -30,7 +30,7 @@ rules:
func-style: ["error", "declaration"]
init-declarations: "off"
no-plusplus: "off"
no-extra-parens: off
no-extra-parens: "off"
id-length: ["error", {"exceptions": ["i", "k", "x", "y"]}]
object-shorthand: "off"
max-statements: ["error", {"max": 40}]

View File

@ -49,6 +49,26 @@ MATCHERS = {
},
],
"yamllint": [
{
"pattern": [
{
"regexp": r"^\033\[4m([^\033]+)\033\[0m$",
"file": 1,
},
{
"regexp": r"^ \033\[2m(\d+):(\d+)\033\[0m \033\[3[13]m([^\033]+)\033\[0m +([^\033]*)\033\[2m\(([^)]+)\)\033\[0m$",
"line": 1,
"column": 2,
"severity": 3,
"message": 4,
"code": 5,
"loop": True,
},
],
},
],
# filename.py:313: unused function 'i_am_never_used' (60% confidence)
"vulture": [
{
@ -160,7 +180,7 @@ MATCHERS = {
},
],
},
]
],
}

View File

@ -206,6 +206,13 @@ deps =
commands =
{envpython} -m mypy qutebrowser tests {posargs}
[testenv:yamllint]
basepython = {env:PYTHON:python3}
pip_version = pip
deps = -r{toxinidir}/misc/requirements/requirements-yamllint.txt
commands =
{envpython} -m yamllint -f colored --strict . {posargs}
[testenv:mypy-diff]
basepython = {env:PYTHON:python3}
pip_version = pip