Skip to content

Commit

Permalink
Merge branch 'stephenfin/blackify'
Browse files Browse the repository at this point in the history
Closes #877
  • Loading branch information
akrabat committed Jul 4, 2020
2 parents 9c13a28 + dc07f24 commit 2cdc928
Show file tree
Hide file tree
Showing 53 changed files with 3,592 additions and 2,322 deletions.
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,37 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
# TODO(stephenfin): Enable flake8 when it's passing
---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
# NOTE(stephenfin): This is needed until the fix for
# https://github.com/psf/black/issues/438 is released
exclude: rst2pdf/tests/input
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: trailing-whitespace
exclude: rst2pdf/tests/input
- id: mixed-line-ending
args: ['--fix', 'lf']
exclude: rst2pdf/tests/input
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: end-of-file-fixer
exclude: rst2pdf/tests/input
- id: check-yaml
files: .*\.(yaml|yml)$
- id: check-added-large-files
# - repo: https://gitlab.com/pycqa/flake8
# rev: 3.8.3
# hooks:
# - id: flake8
34 changes: 22 additions & 12 deletions .travis.yml
Expand Up @@ -2,25 +2,35 @@
filter_secrets: false
os: linux
dist: xenial

addons:
apt:
packages:
- inkscape
- texlive-latex-base
- dvipng
- plantuml

language: python
python:
- 3.6
- 3.7
- 3.8

before_install:
cache:
pip: true
directories:
- $HOME/.cache/pre-commit
install:
- pip install --upgrade setuptools
- pip install pytest
- pip install -c requirements.txt -e .[tests,sphinx,images,svgsupport,aafiguresupport,mathsupport,rawhtmlsupport]

- pip install pytest pre-commit
- pip install -c requirements.txt -e .[tests,sphinx,svgsupport,aafiguresupport,mathsupport,rawhtmlsupport]
env:
- TEST_CMD="pytest"
script:
- pytest
- $TEST_CMD
matrix:
include:
- name: "lint"
python: 3.6
env:
- TEST_CMD="pre-commit run --all-files"
- name: "3.6"
python: 3.6
- name: "3.7"
python: 3.7
- name: "3.8"
python: 3.8
1 change: 0 additions & 1 deletion ISSUE_TEMPLATE.md
Expand Up @@ -33,4 +33,3 @@ Which operating system are you using?
<!-- Please provide further information about the issure/feature request -->
<!--- If this is a feature request, why is this change important to you? -->
<!--- How can it benefit other users? -->

1 change: 0 additions & 1 deletion README.rst
Expand Up @@ -129,4 +129,3 @@ Contributing
rst2pdf wishes to be a welcoming community. With that in mind, please refer to our `Community Code of Conduct`__.

__ CODE_OF_CONDUCT.rst

16 changes: 16 additions & 0 deletions doc/DEVELOPERS.rst
Expand Up @@ -93,6 +93,22 @@ It's important that you do it this way because it means that the rest of us
know what you are doing. It also means you don't break rst2pdf.


Pre-commit
~~~~~~~~~~

*rst2pdf* uses the `pre-commit`__ framework to automate various style checkers.
This must be enabled locally. You can install this using *pip* or your local
package manager. For example, to install using *pip*::

pip install pre-commit

Once installed, enable it like so::

pre-commit install --allow-missing-config

.. __: https://pre-commit.com/


Continuous Integration
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 4 additions & 4 deletions doc/assets/config.sample
Expand Up @@ -42,8 +42,8 @@ fit_background_mode="center"

break_level=0

# How section breaks work. Can be "even", and sections start in an
# even page, "odd", and sections start in odd pages, or "any" and
# How section breaks work. Can be "even", and sections start in an
# even page, "odd", and sections start in odd pages, or "any" and
# sections start in the next page, be it even or odd.

break_side="any"
Expand Down Expand Up @@ -77,10 +77,10 @@ footnote_backlinks=true
inline_footnotes=false

# Cover page template.
# It will be searched in the document's folder, in ~/.rst2pdf/templates and
# It will be searched in the document's folder, in ~/.rst2pdf/templates and
# in the templates subfolder of the package folder

# custom_cover = cover.tmpl
# custom_cover = cover.tmpl

# Use floating images.
# Makes the behaviour of images with the :align: attribute more like rst2html's
Expand Down

0 comments on commit 2cdc928

Please sign in to comment.