From b0b69ce81972bbc23d1081289e4e409bc13bdd9a Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 31 Jan 2020 19:14:51 +0000 Subject: [PATCH] lint/pre-commit/ci: replace shfmt => beautysh --- .pre-commit-config.yaml | 7 ++++--- .travis.yml | 9 +-------- scripts/ci/check_patch.sh | 5 +---- scripts/ci/check_scripts.sh | 9 --------- 4 files changed, 6 insertions(+), 24 deletions(-) delete mode 100755 scripts/ci/check_scripts.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a64750c783..a2c5d11fe7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,8 +9,9 @@ repos: hooks: - id: flake8 language_version: python3 -- repo: https://github.com/casperdcl/sh +- repo: https://github.com/lovesegfault/beautysh rev: master hooks: - - id: shfmt - language: golang + - id: beautysh + language_version: python3 + args: [-i, '2'] # 2-space indentaion diff --git a/.travis.yml b/.travis.yml index 62f6dd39f8..971a2bb9e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ stages: jobs: include: # patch formatting checks - - name: "Python formatting" + - name: "Check patch formatting" stage: check os: linux language: python @@ -32,13 +32,6 @@ jobs: before_install: install: script: ./scripts/ci/check_patch.sh - - name: "Script formatting" - os: linux - language: go - go: 1.13 - before_install: - install: - script: ./scripts/ci/check_scripts.sh # test jobs - name: "3.7 on Windows" stage: test diff --git a/scripts/ci/check_patch.sh b/scripts/ci/check_patch.sh index b1935da6a3..f357086349 100755 --- a/scripts/ci/check_patch.sh +++ b/scripts/ci/check_patch.sh @@ -9,7 +9,4 @@ pip install Pygments collective.checkdocs pre-commit python setup.py checkdocs # stop the build if there are any formatting errors -err=0 -pre-commit run --all-files black || err=1 -pre-commit run --all-files flake8 || err=1 -exit $err +pre-commit run --all-files diff --git a/scripts/ci/check_scripts.sh b/scripts/ci/check_scripts.sh deleted file mode 100755 index e33dd0b6b8..0000000000 --- a/scripts/ci/check_scripts.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -x -set -e - -GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt - -# stop the build if there are any formatting errors -shfmt -l -d -i 2 -ci -w .