From 8e7e829a20808c26135d6d8a3d939f322a13016f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 15 Oct 2020 21:36:56 +0300 Subject: [PATCH] Add pre-commit to CI, update all linters (#21) --- .github/workflows/lint.yml | 12 ++++++++++++ .pre-commit-config.yaml | 20 ++++++++++---------- noxfile.py | 4 +++- src/furo/assets/styles/_variables.scss | 6 ++++-- 4 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..bda0c64e2 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: Lint + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f3d93b3c7..d9c0f3890 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,23 +1,23 @@ repos: - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black language_version: python3.8 - - repo: https://github.com/timothycrosley/isort - rev: 5.0.4 + - repo: https://github.com/PyCQA/isort + rev: 5.6.4 hooks: - id: isort files: \.py$ - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 + rev: 3.8.4 hooks: - id: flake8 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 + rev: v3.2.0 hooks: - id: check-builtin-literals - id: check-added-large-files @@ -29,20 +29,20 @@ repos: - id: forbid-new-submodules - id: trailing-whitespace - - repo: https://github.com/PyCQA/pydocstyle.git - rev: 5.0.2 + - repo: https://github.com/PyCQA/pydocstyle + rev: 5.1.1 hooks: - id: pydocstyle files: src/.*\.py$ - repo: https://github.com/asottile/blacken-docs - rev: v1.7.0 + rev: v1.8.0 hooks: - id: blacken-docs - additional_dependencies: [black==19.10b0] + additional_dependencies: [black==20.8b1] - repo: https://github.com/prettier/prettier - rev: 2.1.1 + rev: 2.1.2 hooks: - id: prettier exclude: src/furo/theme/.*|docs/reference/admonitions.md diff --git a/noxfile.py b/noxfile.py index 8a875ea91..6d9cacd4b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -112,7 +112,9 @@ def get_release_versions(version_file): @nox.session def release(session): version_file = f"src/{PACKAGE_NAME}/__init__.py" - allowed_upstreams = [f"git@github.com:pradyunsg/{PACKAGE_NAME.replace('_', '-')}.git"] + allowed_upstreams = [ + f"git@github.com:pradyunsg/{PACKAGE_NAME.replace('_', '-')}.git" + ] release_version, next_version = get_release_versions(version_file) diff --git a/src/furo/assets/styles/_variables.scss b/src/furo/assets/styles/_variables.scss index 654a3ed75..5cb00e974 100644 --- a/src/furo/assets/styles/_variables.scss +++ b/src/furo/assets/styles/_variables.scss @@ -36,8 +36,10 @@ $admonitions: ( // Fonts ////////////////////////////////////////////////////////////////////////////// // These are adapted from https://systemfontstack.com/ - --font-stack: -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, Ubuntu, roboto, noto, segoe ui, arial, sans-serif; - --font-stack--monospace: "SFMono-Regular", Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; + --font-stack: -apple-system, BlinkMacSystemFont, avenir next, avenir, + helvetica neue, helvetica, Ubuntu, roboto, noto, segoe ui, arial, sans-serif; + --font-stack--monospace: "SFMono-Regular", Menlo, Consolas, Monaco, + Liberation Mono, Lucida Console, monospace; --font-size--normal: 100%; --font-size--small: 87.5%;