From aabb0dadc1a87ff828544a87925284a1b1cc8ef0 Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Sat, 18 Jul 2020 17:51:18 +0200 Subject: [PATCH] increase text linting in pre-commit, vim etc --- dot_git-template/.pre-commit-config.yaml | 4 ++++ dot_scripts/npmdeps.sh | 2 ++ dot_scripts/pythondeps.sh | 10 +++++----- dot_vimrc | 2 +- dot_zsh_functions | 6 ++++-- requirements.txt | 5 +++-- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dot_git-template/.pre-commit-config.yaml b/dot_git-template/.pre-commit-config.yaml index 2315119..8696044 100644 --- a/dot_git-template/.pre-commit-config.yaml +++ b/dot_git-template/.pre-commit-config.yaml @@ -114,3 +114,7 @@ repos: language: docker_image entry: --entrypoint /usr/local/bin/run-jflint.sh askulkarni2/jenkinslint files: Jenkinsfile + - repo: git@github.com:amperser/proselint.git + rev: 0.10.2 + hooks: + - id: proselint diff --git a/dot_scripts/npmdeps.sh b/dot_scripts/npmdeps.sh index 27ef965..40bf5fd 100755 --- a/dot_scripts/npmdeps.sh +++ b/dot_scripts/npmdeps.sh @@ -7,5 +7,7 @@ echo "Installing moro, a productivity CLI tool" npm install -g moro echo "Install wiki CLI tool" npm install -g wikit +echo "Install Write-good CLI spell checker" +npm install -g write-good cd "$HOME" || exit diff --git a/dot_scripts/pythondeps.sh b/dot_scripts/pythondeps.sh index 3ee110c..fe5eb7d 100755 --- a/dot_scripts/pythondeps.sh +++ b/dot_scripts/pythondeps.sh @@ -6,11 +6,11 @@ sudo pip install --upgrade pip curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo python3 get-pip.py case "$(uname -s)" in - Darwin) - echo "(Mac OS X) Updating PATH for loading pip user installed packages" - ln -snf /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/pip pip3 - export PATH="$PATH:/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/:/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin" - ;; +Darwin) + echo "(Mac OS X) Updating PATH for loading pip user installed packages" + ln -snf /usr/local/opt/python/bin//pip3.8 /usr/local/bin/pip3 + export PATH="$PATH:/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/:/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/opt/python/bin/" + ;; esac echo "Upgrading pip" sudo pip install --upgrade pip diff --git a/dot_vimrc b/dot_vimrc index d440ecc..e976a88 100644 --- a/dot_vimrc +++ b/dot_vimrc @@ -116,7 +116,7 @@ let g:ale_fixers = { \ 'zsh' : ['shfmt'], \} -let g:ale_linters = {'zsh': ['shellcheck']} +let g:ale_linters = {'zsh': ['shellcheck'], 'text': ['writegood', 'proselint']} " when running at every change you may want to disable quickfix let g:prettier#quickfix_enabled = 1 diff --git a/dot_zsh_functions b/dot_zsh_functions index 00a033a..931ddc8 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -278,13 +278,15 @@ function invalid_file_refs() { # Text search -# run aspell in non interactive mode, to list all mispelled words found +# run write-good, proselint, and aspell in non interactive mode, to list all mispelled words found function checkenlist() { aspell -d en list < "$1" | sort --unique --ignore-case + write-good "$1" | sort --unique --ignore-case + proselint "$1" | sort --unique --ignore-case } function checkenremote() { - curl --location --insecure --silent "$1" > /tmp/file && checkenlist /tmp/file + curl --location --insecure --silent "$1" > /tmp/file && checkenlist /tmp/file && write-good /tmp/file && proselint /tmp/file } # Time management diff --git a/requirements.txt b/requirements.txt index 70e1813..d5f91d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,6 @@ cachetools==3.1.1 certifi==2019.9.11 cffi==1.13.2 chardet==3.0.4 -Click==7.0 colorama==0.4.1 colorzero==1.1 configobj==5.0.6 @@ -120,7 +119,6 @@ Scrapy==1.8.0 semver==2.9.0 service-identity==18.1.0 sh==1.12.14 -six==1.13.0 slacker==0.13.0 soupsieve==1.9.5 stashy==0.6 @@ -147,3 +145,6 @@ websocket-client==0.56.0 wrapt==1.11.2 yamllint==1.23.0 zope.interface==4.6.0 +click==7.1.2 +proselint==0.10.2 +six==1.15.0