Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Converts tabs to spaces and update EditorConfig for the new files

Trenton Holmesbdcc6f861d46
diff --git a/.editorconfig b/.editorconfig
index 125108a0c..8111f01d8 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -33,5 +33,5 @@ indent_style = space
[**/test_*.py]
max_line_length = off
-[Dockerfile]
+[Dockerfile*]
indent_style = space
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 32998e432..f0bf9bace 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -47,7 +47,7 @@ repos:
- id: yesqa
exclude: "(migrations)"
- repo: https://github.com/asottile/add-trailing-comma
- rev: "v2.2.2"
+ rev: "v2.2.3"
hooks:
- id: add-trailing-comma
exclude: "(migrations)"
@@ -64,16 +64,16 @@ repos:
- id: black
# Dockerfile hooks
- repo: https://github.com/AleksaC/hadolint-py
- rev: v1.19.0
+ rev: v2.10.0
hooks:
- id: hadolint
args:
- - --ignore
- - DL3006 # https://github.com/hadolint/hadolint/wiki/DL3006 (doesn't understand FROM with ARG)
- --ignore
- DL3008 # https://github.com/hadolint/hadolint/wiki/DL3008 (should probably do this at some point)
- --ignore
- DL3013 # https://github.com/hadolint/hadolint/wiki/DL3013 (should probably do this too at some point)
+ - --ignore
+ - DL3003 # https://github.com/hadolint/hadolint/wiki/DL3003 (seems excessive to use WORKDIR so much)
# Shell script hooks
- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
diff --git a/docker-builders/Dockerfile.frontend b/docker-builders/Dockerfile.frontend
index 0caec0030..26f6c9e15 100644
--- a/docker-builders/Dockerfile.frontend
+++ b/docker-builders/Dockerfile.frontend
@@ -8,7 +8,7 @@ COPY ./src-ui /src/src-ui
WORKDIR /src/src-ui
RUN set -eux \
- && npm update npm -g \
- && npm ci --no-optional
+ && npm update npm -g \
+ && npm ci --no-optional
RUN set -eux \
- && ./node_modules/.bin/ng build --configuration production
+ && ./node_modules/.bin/ng build --configuration production
diff --git a/docker-builders/Dockerfile.jbig2enc b/docker-builders/Dockerfile.jbig2enc
index 72429ec0b..4bc633170 100644
--- a/docker-builders/Dockerfile.jbig2enc
+++ b/docker-builders/Dockerfile.jbig2enc
@@ -1,6 +1,6 @@
# This Dockerfile compiles the jbig2enc library
# Inputs:
-# - JBIG2ENC_VERSION - the Git tag to checkout and build
+# - JBIG2ENC_VERSION - the Git tag to checkout and build
FROM debian:bullseye-slim
@@ -32,8 +32,8 @@ RUN apt-get update --quiet \
ARG JBIG2ENC_VERSION
RUN set -eux \
- && git clone --quiet --branch $JBIG2ENC_VERSION https://github.com/agl/jbig2enc .
+ && git clone --quiet --branch $JBIG2ENC_VERSION https://github.com/agl/jbig2enc .
RUN set -eux \
- && ./autogen.sh
+ && ./autogen.sh
RUN set -eux \
- && ./configure && make
+ && ./configure && make
diff --git a/docker-builders/Dockerfile.pikepdf b/docker-builders/Dockerfile.pikepdf
index 7325bceff..3d2e5f235 100644
--- a/docker-builders/Dockerfile.pikepdf
+++ b/docker-builders/Dockerfile.pikepdf
@@ -1,9 +1,9 @@
# This Dockerfile builds the pikepdf wheel
# Inputs:
-# - REPO - Docker repository to pull qpdf from
-# - QPDF_VERSION - The image qpdf version to copy .deb files from
-# - PIKEPDF_GIT_TAG - The Git tag to clone and build from
-# - PIKEPDF_VERSION - Used to force the built pikepdf version to match
+# - REPO - Docker repository to pull qpdf from
+# - QPDF_VERSION - The image qpdf version to copy .deb files from
+# - PIKEPDF_GIT_TAG - The Git tag to clone and build from
+# - PIKEPDF_VERSION - Used to force the built pikepdf version to match
# Default to pulling from the main repo registry when manually building
ARG REPO="paperless-ngx/paperless-ngx"
@@ -53,7 +53,7 @@ ARG PIKEPDF_GIT_TAG
ARG PIKEPDF_VERSION
RUN set -eux \
- && echo "building pikepdf wheel" \
+ && echo "building pikepdf wheel" \
# Note the v in the tag name here
&& git clone --quiet --depth 1 --branch "${PIKEPDF_GIT_TAG}" https://github.com/pikepdf/pikepdf.git \
&& cd pikepdf \
diff --git a/docker-builders/Dockerfile.psycopg2 b/docker-builders/Dockerfile.psycopg2
index cbfbba7c1..cfd7ff56a 100644
--- a/docker-builders/Dockerfile.psycopg2
+++ b/docker-builders/Dockerfile.psycopg2
@@ -1,7 +1,7 @@
# This Dockerfile builds the psycopg2 wheel
# Inputs:
-# - PSYCOPG2_GIT_TAG - The Git tag to clone and build from
-# - PSYCOPG2_VERSION - Unused, kept for future possible usage
+# - PSYCOPG2_GIT_TAG - The Git tag to clone and build from
+# - PSYCOPG2_VERSION - Unused, kept for future possible usage
FROM python:3.9-slim-bullseye
@@ -25,7 +25,7 @@ RUN set -eux \
&& apt-get update --quiet \
&& apt-get install --yes --quiet --no-install-recommends $BUILD_PACKAGES \
&& rm -rf /var/lib/apt/lists/* \
- && python3 -m pip install --upgrade pip wheel
+ && python3 -m pip install --no-cache-dir --upgrade pip wheel
# Layers after this point change according to required version
# For better caching, seperate the basic installs from
@@ -35,7 +35,7 @@ ARG PSYCOPG2_GIT_TAG
ARG PSYCOPG2_VERSION
RUN set -eux \
- && echo "Building psycopg2 wheel" \
+ && echo "Building psycopg2 wheel" \
&& cd /usr/src \
&& git clone --quiet --depth 1 --branch ${PSYCOPG2_GIT_TAG} https://github.com/psycopg/psycopg2.git \
&& cd psycopg2 \
diff --git a/docker-builders/Dockerfile.qpdf b/docker-builders/Dockerfile.qpdf
index c56a515c4..770d8c2ee 100644
--- a/docker-builders/Dockerfile.qpdf
+++ b/docker-builders/Dockerfile.qpdf
@@ -36,16 +36,17 @@ ARG QPDF_VERSION
# In order to get the required version of qpdf, it is backported from bookwork
# and then built from source
RUN set -eux \
- && echo "Building qpdf" \
- && echo "deb-src http://deb.debian.org/debian/ bookworm main" | tee /etc/apt/sources.list.d/bookworm-src.list \
+ && echo "Building qpdf" \
+ && echo "deb-src http://deb.debian.org/debian/ bookworm main" > /etc/apt/sources.list.d/bookworm-src.list \
&& apt-get update \
&& mkdir qpdf \
&& cd qpdf \
&& apt-get source --yes --quiet qpdf=${QPDF_VERSION}-1/bookworm \
&& rm -rf /var/lib/apt/lists/* \
&& cd qpdf-$QPDF_VERSION \
+ # We don't need to build the tests (also don't run them)
+ && rm -rf libtests \
&& [email protected] debchange --bpo \
- && export DEB_BUILD_OPTIONS="terse nocheck nodoc parallel=2" \
+ && export DEB_BUILD_OPTIONS="terse nocheck nodoc parallel=2" \
&& dpkg-buildpackage --build=binary --unsigned-source --unsigned-changes \
- && pwd \
&& ls -ahl ../*.deb
diff --git a/docs/Dockerfile b/docs/Dockerfile
index 9fb8bd0cc..bb4b35e2d 100644
--- a/docs/Dockerfile
+++ b/docs/Dockerfile
@@ -1,10 +1,10 @@
FROM python:3.5.1
# Install Sphinx and Pygments
-RUN pip install Sphinx Pygments
+RUN pip install --no-cache-dir Sphinx Pygments \
+ # Setup directories, copy data
+ && mkdir /build
-# Setup directories, copy data
-RUN mkdir /build
COPY . /build
WORKDIR /build/docs