diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5aecfc6f..47422e09 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,18 +1,21 @@ -name: deploy on: pull_request: push: - branches: [real_master] + branches: [main] schedule: - cron: '30 8 * * *' +permissions: + contents: write + jobs: - build: - name: pr + pr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x - run: pip install virtualenv - run: make - run: make push diff --git a/.gitignore b/.gitignore index 2deee430..8658b840 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,4 @@ *.html *.pyc -*.swp -/.mypy_cache -/all-hooks.json /build /node_modules -/venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db44772d..84487e17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,49 +1,43 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: debug-statements -- repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 - hooks: - - id: flake8 -- repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.4.4 - hooks: - - id: autopep8 -- repo: https://github.com/asottile/reorder_python_imports - rev: v1.8.0 + - id: double-quote-string-fixer + - id: name-tests-test + - id: requirements-txt-fixer +- repo: https://github.com/asottile/reorder-python-imports + rev: v3.16.0 hooks: - id: reorder-python-imports + args: [--py310-plus, --add-import, 'from __future__ import annotations'] + - id: reorder-python-imports +- repo: https://github.com/asottile/add-trailing-comma + rev: v4.0.0 + hooks: + - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v1.25.2 + rev: v3.21.2 hooks: - id: pyupgrade - args: [--py36-plus] - exclude: ^install-local.py$ + args: [--py310-plus] +- repo: https://github.com/hhatto/autopep8 + rev: v2.3.2 + hooks: + - id: autopep8 +- repo: https://github.com/PyCQA/flake8 + rev: 7.3.0 + hooks: + - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.761 + rev: v1.19.1 hooks: - id: mypy - exclude: ^install-local.py$ -- repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.0.0-alpha.3 - hooks: - - id: eslint - args: [--fix] -- repo: local - hooks: - - id: scss-lint - name: scss-lint - entry: scss-lint - types: [scss] - language: ruby - additional_dependencies: ['scss_lint:0.57.0'] - - id: no-github-dot-git - name: No need for .git for github/gitlab urls - entry: '(github|gitlab).*\.git' - files: all-repos.yaml - language: pygrep +- repo: https://github.com/biomejs/pre-commit + rev: v2.3.10 + hooks: + - id: biome-check + additional_dependencies: ["@biomejs/biome@1.8.1"] diff --git a/Makefile b/Makefile index 31b669d1..81533eda 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,13 @@ -# To build scss continuously I use `watch -n 0.1 make build/main.css` - -all: install-hooks build/main.css all-hooks.json index.html hooks.html +all: install-hooks build/main_bs5.css index.html hooks.html .PHONY: install-hooks install-hooks: venv venv/bin/pre-commit install -build/main.css: venv node_modules build scss/main.scss scss/_variables.scss - venv/bin/pysassc -s compressed scss/main.scss build/main.css - -all-hooks.json: venv make_all_hooks.py all-repos.yaml - venv/bin/python make_all_hooks.py +build/main_bs5.css: node_modules build scss/main_bs5.scss scss/_variables.scss + node_modules/.bin/sass --style=compressed --load-path=. scss/main_bs5.scss build/main_bs5.css -index.html hooks.html: venv all-hooks.json base.mako index.mako hooks.mako make_templates.py +index.html hooks.html: venv base.mako index.mako hooks.mako make_templates.py template_lib.py sections/*.md venv/bin/python make_templates.py venv: requirements-dev.txt Makefile @@ -29,14 +24,11 @@ node_modules: package.json push: venv venv/bin/markdown-to-presentation push \ - --master-branch real_master \ - --pages-branch master \ .nojekyll README.md CNAME \ - build assets node_modules *.html *.png *.svg favicon.ico \ - all-hooks.json install-local.py + build assets *.html *.png *.svg favicon.ico clean: - rm -rf venv build node_modules *.html all-hooks.json + rm -rf venv build node_modules *.html build: mkdir -p build diff --git a/README.md b/README.md index 9999ed5d..c311257b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -pre-commit.github.io -==================== +pre-commit.com +============== -[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/pre-commit.pre-commit.github.io?branchName=real_master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=58&branchName=real_master) -[![Build Status](https://github.com/pre-commit/pre-commit.github.io/workflows/deploy/badge.svg)](https://github.com/pre-commit/pre-commit.github.io/actions) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/pre-commit.com/main.svg)](https://results.pre-commit.ci/latest/github/pre-commit/pre-commit.com/main) +[![Build Status](https://github.com/pre-commit/pre-commit.com/actions/workflows/deploy.yml/badge.svg)](https://github.com/pre-commit/pre-commit.com/actions) This powers https://pre-commit.com diff --git a/all-repos.yaml b/all-repos.yaml deleted file mode 100644 index 010bab9e..00000000 --- a/all-repos.yaml +++ /dev/null @@ -1,132 +0,0 @@ -# This file is used to generate all-hooks.json -- https://github.com/pre-commit/pre-commit-hooks -- https://github.com/pre-commit/mirrors-autopep8 -- https://github.com/pre-commit/mirrors-coffeelint -- https://github.com/pre-commit/mirrors-csslint -- https://github.com/pre-commit/mirrors-eslint -- https://github.com/pre-commit/mirrors-fixmyjs -- https://github.com/pre-commit/mirrors-isort -- https://github.com/pre-commit/mirrors-jshint -- https://github.com/pre-commit/mirrors-mypy -- https://github.com/pre-commit/mirrors-puppet-lint -- https://github.com/pre-commit/mirrors-ruby-lint -- https://github.com/pre-commit/mirrors-scss-lint -- https://github.com/pre-commit/mirrors-yapf -- https://github.com/pre-commit/pygrep-hooks -- https://github.com/FalconSocial/pre-commit-mirrors-pep257 -- https://github.com/FalconSocial/pre-commit-python-sorter -- https://github.com/guykisel/pre-commit-robotframework-tidy -- https://github.com/guykisel/prospector-mirror -- https://github.com/asottile/add-trailing-comma -- https://github.com/asottile/pyupgrade -- https://github.com/asottile/reorder_python_imports -- https://github.com/asottile/yesqa -- https://github.com/asottile/seed-isort-config -- https://github.com/asottile/blacken-docs -- https://github.com/asottile/dead -- https://github.com/asottile/setup-cfg-fmt -- https://github.com/asottile/cheetah_lint -- https://github.com/digitalpulp/pre-commit-php -- https://github.com/elidupuis/mirrors-jscs -- https://github.com/elidupuis/mirrors-sass-lint -- https://github.com/jumanjihouse/pre-commit-hooks -- https://github.com/jumanjihouse/pre-commit-hook-yamlfmt -- https://github.com/Lucas-C/pre-commit-hooks -- https://github.com/Lucas-C/pre-commit-hooks-go -- https://github.com/Lucas-C/pre-commit-hooks-java -- https://github.com/Lucas-C/pre-commit-hooks-lxml -- https://github.com/Lucas-C/pre-commit-hooks-markup -- https://github.com/Lucas-C/pre-commit-hooks-nodejs -- https://github.com/Lucas-C/pre-commit-hooks-safety -- https://github.com/chriskuehl/puppet-pre-commit-hooks -- https://github.com/golangci/golangci-lint -- https://github.com/Bahjat/pre-commit-golang -- https://github.com/dnephin/pre-commit-golang -- https://github.com/troian/pre-commit-golang -- https://github.com/jstewmon/check-swagger -- https://github.com/detailyang/pre-commit-shell -- https://github.com/bemeurer/beautysh -- https://github.com/antonbabenko/pre-commit-terraform -- https://github.com/ansible/ansible-lint -- https://github.com/doublify/pre-commit-clang-format -- https://github.com/doublify/pre-commit-go -- https://github.com/doublify/pre-commit-hindent -- https://github.com/doublify/pre-commit-isort -- https://github.com/doublify/pre-commit-rust -- https://github.com/kintoandar/pre-commit -- https://github.com/awebdeveloper/pre-commit-stylelint -- https://github.com/awebdeveloper/pre-commit-tslint -- https://github.com/awebdeveloper/pre-commit-prettier -- https://github.com/prettier/prettier -- https://github.com/adrienverge/yamllint -- https://github.com/thlorenz/doctoc -- https://github.com/noahsark769/xcodeproj-sort-pre-commit-hook -- https://github.com/jorisroovers/gitlint -- https://github.com/psf/black -- https://github.com/IamTheFij/ansible-pre-commit -- https://github.com/IamTheFij/docker-pre-commit -- https://github.com/mattlqx/pre-commit-ruby -- https://github.com/mattlqx/pre-commit-sign -- https://github.com/mattlqx/pre-commit-search-and-replace -- https://github.com/openstack-dev/bashate -- https://github.com/pryorda/dockerfilelint-precommit-hooks -- https://github.com/alessandrojcm/commitlint-pre-commit-hook -- https://github.com/henryykt/pre-commit-perl -- https://github.com/juancarlospaco/pre-commit-nim -- https://github.com/awslabs/cfn-python-lint -- https://github.com/thoughtworks/talisman -- https://gitlab.com/PyCQA/flake8 -- https://github.com/PyCQA/bandit -- https://github.com/PyCQA/pydocstyle -- https://github.com/PyCQA/pylint -- https://github.com/miki725/importanize -- https://github.com/motet-a/jinjalint -- https://github.com/milin/giticket -- https://github.com/sqlalchemyorg/zimports -- https://github.com/peterdemin/pip-compile-multi -- https://github.com/homebysix/pre-commit-macadmin -- https://github.com/fortman/pre-commit-prometheus -- https://github.com/syntaqx/git-hooks -- https://github.com/Calinou/pre-commit-luacheck -- https://github.com/belminf/pre-commit-chef -- https://github.com/timothycrosley/isort -- https://github.com/pocc/pre-commit-hooks -- https://github.com/dwightgunning/pre-commit-nglint -- https://github.com/codespell-project/codespell -- https://gitlab.com/smop/pre-commit-hooks -- https://github.com/seddonym/import-linter -- https://github.com/marco-c/taskcluster_yml_validator -- https://github.com/myint/docformatter -- https://github.com/lorenzwalthert/precommit -- https://github.com/FelixSeptem/pre-commit-golang -- https://gitlab.com/daverona/pre-commit-cpp -- https://github.com/codingjoe/relint -- https://github.com/nix-community/nixpkgs-fmt -- https://github.com/d6e/beancount-check -- https://github.com/iconmaster5326/cmake-format-pre-commit-hook -- https://github.com/thg-consulting/inspectortiger -- https://gitlab.com/iamlikeme/nbhooks -- https://github.com/Kuniwak/vint -- https://github.com/eschulte/lisp-format -- https://github.com/shellcheck-py/shellcheck-py -- https://github.com/APIDevTools/swagger-cli -- https://github.com/kynan/nbstripout -- https://gitlab.com/devopshq/gitlab-ci-linter -- https://github.com/bmorcos/pre-commit-hooks-cpp -- https://github.com/igorshubovych/markdownlint-cli -- https://github.com/TekWizely/pre-commit-golang -- https://github.com/markdownlint/markdownlint -- https://github.com/jguttman94/pre-commit-gradle -- https://github.com/Yelp/detect-secrets -- https://github.com/dmitri-lerko/pre-commit-docker-kustomize -- https://github.com/perltidy/perltidy -- https://github.com/talos-systems/conform -- https://github.com/twu/skjold -- https://github.com/woile/commitizen -- https://github.com/gherynos/pre-commit-java -- https://github.com/JamesWoolfenden/pre-commit -- https://github.com/lietu/go-pre-commit -- https://github.com/macisamuele/language-formatters-pre-commit-hooks -- https://github.com/jlebar/pre-commit-hooks -- https://github.com/jazzband/pip-tools -- https://github.com/pappasam/toml-sort diff --git a/assets/copyable.js b/assets/copyable.js index 8aba102f..7d18e25b 100644 --- a/assets/copyable.js +++ b/assets/copyable.js @@ -1,6 +1,8 @@ -(function () { +'use strict'; + +(() => { function copyTextToClipboard(text) { - var textArea = document.createElement('textarea'); + const textArea = document.createElement('textarea'); textArea.value = text; textArea.style.position = 'fixed'; textArea.style.left = '-1'; @@ -11,17 +13,15 @@ document.execCommand('copy'); document.body.removeChild(textArea); } - var codeBlockElements = document.getElementsByClassName('copyable'); - for (var i = 0; i < codeBlockElements.length; i++) { - var block = codeBlockElements[i]; - var copyIcon = new Image(16, 16); + for (const block of document.getElementsByClassName('copyable')) { + const copyIcon = new Image(16, 16); copyIcon.setAttribute('src', './assets/copy-icon.svg'); copyIcon.setAttribute('alt', 'copy'); copyIcon.setAttribute('title', 'copy to clipboard'); block.insertBefore(copyIcon, block.children[0]); - copyIcon.addEventListener('click', function(block) { - var text = block.getElementsByTagName('pre')[0].innerText; + copyIcon.addEventListener('click', () => { + const text = block.getElementsByTagName('pre')[0].innerText; copyTextToClipboard(text); - }.bind(null, block)); + }); } })(); diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ed46fb18..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,16 +0,0 @@ -trigger: - branches: - include: [real_master, test-me-*] - tags: - include: ['*'] - -resources: - repositories: - - repository: asottile - type: github - endpoint: github - name: asottile/azure-pipeline-templates - ref: refs/tags/v1.0.0 - -jobs: -- template: job--pre-commit.yml@asottile diff --git a/base.mako b/base.mako index 640d2add..77ba61f4 100644 --- a/base.mako +++ b/base.mako @@ -2,69 +2,91 @@ - - - - - + + + + + + + pre-commit - -