Skip to content
Snippets Groups Projects
Commit 642d06df authored by nimrod's avatar nimrod
Browse files

pre-commit.

- Adding checks.
- Add to CI.
- Address issues.
parent 262f5a05
No related branches found
No related tags found
No related merge requests found
.envrc 100755 → 100644
File mode changed from 100755 to 100644
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
include:
- project: shore/ci-templates
file: templates/pre-commit.yml
build: build:
tags: ["host01.shore.co.il"] tags: ["host01.shore.co.il"]
script: script:
...@@ -15,4 +19,5 @@ build: ...@@ -15,4 +19,5 @@ build:
--volume "/var/www/www.shore.co.il/blog:/builds/nimrod/blog/output" --volume "/var/www/www.shore.co.il/blog:/builds/nimrod/blog/output"
--workdir "$PWD" --workdir "$PWD"
adarnimrod/ci-images:python3 adarnimrod/ci-images:python3
/bin/sh -xc "pipenv --python=python3 install && pipenv run clean && pipenv run build" /bin/sh -xc
"pipenv --python=python3 install && pipenv run clean && pipenv run build"
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-toml
files: Pipfile
- id: trailing-whitespace
- repo: https://github.com/Yelp/detect-secrets
rev: v0.14.3
hooks:
- id: detect-secrets
exclude: Pipfile\.lock
- repo: https://github.com/adrienverge/yamllint
rev: v1.25.0
hooks:
- id: yamllint
- repo: https://github.com/amperser/proselint/
rev: 0.10.2
hooks:
- id: proselint
types: [plain-text]
exclude: LICENSE
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
args:
- |
--line-length=79
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
rev: v1.0.1
hooks:
- id: rst-linter
exclude: spam\.rst
- repo: https://github.com/myint/rstcheck.git
rev: master
hooks:
- id: rstcheck
- repo: https://github.com/PyCQA/prospector
rev: 1.3.1
hooks:
- id: prospector
args:
- |-
--max-line-length=79
- |-
--with-tool=pyroma
- |-
--with-tool=bandit
- |-
--without-tool=pep257
- |-
--doc-warnings
- |-
--test-warnings
- |-
--full-pep8
- |-
--strictness=high
- |-
--no-autodetect
additional_dependencies:
- bandit
- pyroma
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4
hooks:
- id: flake8
args:
- |-
--doctests
additional_dependencies:
- flake8-bugbear
- repo: https://github.com/executablebooks/mdformat.git
rev: 0.5.3
hooks:
- id: mdformat
...@@ -40,11 +40,11 @@ pipenv run clean ...@@ -40,11 +40,11 @@ pipenv run clean
This software and content are licensed under the This software and content are licensed under the
[Creative Commons - Attribution-NonCommercial-NoDerivatives 4.0 International license](https://creativecommons.org/licenses/by/4.0/) [Creative Commons - Attribution-NonCommercial-NoDerivatives 4.0 International license](https://creativecommons.org/licenses/by/4.0/)
(see `LICENSE.txt). (see `LICENSE.txt`).
## Author Information ## Author Information
Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website]( Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my
https://www.shore.co.il/). Patches are welcome via [`git send-email`]( [website](https://www.shore.co.il/). Patches are welcome via
http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is located [`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository
at: <https://git.shore.co.il/explore>. is located at: <https://git.shore.co.il/expore/>.
bundle_certs bundle certs
############ ############
:date: 2016-03-02 :date: 2016-03-02
......
# -*- coding: utf-8 -*- # # -*- coding: utf-8 -*- #
from __future__ import unicode_literals from __future__ import unicode_literals
AUTHOR = 'Nimrod Adar' AUTHOR = "Nimrod Adar"
SITENAME = 'My notes and ramblings' SITENAME = "My notes and ramblings"
SITEURL = 'http://localhost:8080' SITEURL = "http://localhost:8080"
PATH = 'content' PATH = "content"
TIMEZONE = 'Asia/Jerusalem' TIMEZONE = "Asia/Jerusalem"
DEFAULT_LANG = 'en' DEFAULT_LANG = "en"
# Feed generation is usually not desired when developing # Feed generation is usually not desired when developing
FEED_ALL_ATOM = 'feeds/all.atom.xml' FEED_ALL_ATOM = "feeds/all.atom.xml"
CATEGORY_FEED_ATOM = None CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None AUTHOR_FEED_ATOM = None
...@@ -25,18 +25,18 @@ DEFAULT_PAGINATION = 3 ...@@ -25,18 +25,18 @@ DEFAULT_PAGINATION = 3
# Uncomment following line if you want document-relative URLs when developing # Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True RELATIVE_URLS = True
DIRECT_TEMPLATES = ('index', 'archives') DIRECT_TEMPLATES = ("index", "archives")
DISPLAY_CATEGORIES_ON_MENU = False DISPLAY_CATEGORIES_ON_MENU = False
DISPLAY_PAGES_ON_MENU = True DISPLAY_PAGES_ON_MENU = True
MENUITEMS = (('Code', 'https://git.shore.co.il/explore/'),) MENUITEMS = (("Code", "https://git.shore.co.il/explore/"),)
THEME = "./pelican-mockingbird" THEME = "./pelican-mockingbird"
TAGS_SAVE_AS = '' TAGS_SAVE_AS = ""
TAG_SAVE_AS = '' TAG_SAVE_AS = ""
STATIC_PATHS = ['static'] STATIC_PATHS = ["static"]
ARTICLE_URL = '{slug}/' ARTICLE_URL = "{slug}/"
DELETE_OUTPUT_DIRECTORY = True DELETE_OUTPUT_DIRECTORY = True
SLUGIFY_SOURCE = 'basename' SLUGIFY_SOURCE = "basename"
ARTICLE_SAVE_AS = '{slug}/index.html' ARTICLE_SAVE_AS = "{slug}/index.html"
LOCALE = ('C.UTF-8') LOCALE = "C.UTF-8"
...@@ -5,9 +5,10 @@ from __future__ import unicode_literals ...@@ -5,9 +5,10 @@ from __future__ import unicode_literals
import os import os
import sys import sys
sys.path.append(os.curdir) sys.path.append(os.curdir)
from pelicanconf import * from pelicanconf import * # noqa: E402,F401,F403
SITEURL = 'https://www.shore.co.il/blog' SITEURL = "https://www.shore.co.il/blog"
RELATIVE_URLS = False RELATIVE_URLS = False
PLUGINS = ('minification',) PLUGINS = ("minification",)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment