From b7f511c7ebe7add3d075e45613cd1a2778c48b71 Mon Sep 17 00:00:00 2001
From: Dantali0n <info@dantalion.nl>
Date: Thu, 28 Sep 2023 16:42:55 +0200
Subject: [PATCH] Fix paths and try to fix flake ignored files

---
 .gitlab-ci.yml                                            | 8 ++++++++
 {{cookiecutter.project_slug}}/.gitlab-ci.yml              | 6 ++----
 {{cookiecutter.project_slug}}/pyproject.toml              | 2 ++
 .../src/{{cookiecutter.project_slug}}/cool_module.py      | 2 +-
 {{cookiecutter.project_slug}}/tox.ini                     | 6 +++---
 5 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0e31a2b..fd45bbf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,6 +28,14 @@ default:
     - python -m pip install --upgrade pip
     - pip install --upgrade tox twine
 
+# Override artifact directories
+package_docs:
+  stage: package
+  artifacts:
+    expire_in: 1w
+    paths:
+      - my_awesome_app/docs/build/*
+
 # override package files before script
 package_files:
   before_script:
diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml
index 0632a23..5d15cbf 100644
--- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml
+++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml
@@ -91,14 +91,12 @@ package_files:
 
 package_docs:
   stage: package
-  allow_failure: true
   artifacts:
     expire_in: 1w
     paths:
-      - docs/* # update path to match the dest dir for documentation
+      - docs/build/*
   script:
-    - echo "build and collect docs"
-    - exit 1
+    - tox -e docs
 
 run_integration_tests:
   stage: integration
diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml
index 19e2b25..7409ddd 100644
--- a/{{cookiecutter.project_slug}}/pyproject.toml
+++ b/{{cookiecutter.project_slug}}/pyproject.toml
@@ -47,6 +47,8 @@ archs = ["AMD64", "x86"]
 [tool.pylint]
 ignore = "_version.py"
 
+# This does nothing until the issue below is resolved:
+# https://github.com/PyCQA/flake8/issues/234
 [tool.flake8]
 max-line-length = 88
 extend-ignore = ["E203"]
diff --git a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py
index bd9416c..b71bcac 100644
--- a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py
+++ b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py
@@ -3,4 +3,4 @@
 
 def greeter():
     """Prints a nice message"""
-    print("Hello World!")
+    print("Hello World!, test line over 80 but not 88 characters on a single line")
diff --git a/{{cookiecutter.project_slug}}/tox.ini b/{{cookiecutter.project_slug}}/tox.ini
index 7fd330f..5d298cb 100644
--- a/{{cookiecutter.project_slug}}/tox.ini
+++ b/{{cookiecutter.project_slug}}/tox.ini
@@ -31,13 +31,13 @@ usedevelop = False
 envdir = {toxworkdir}/linting
 commands =
     pep8: {envpython} -m flake8 --version
-    pep8: {envpython} -m flake8 src tests
+    pep8: {envpython} -m flake8 --exclude=_version.py --max-line-length 88 --extend-ignore=E203 src tests
     black: {envpython} -m black --version
     black: {envpython} -m black --check --diff src tests
     pylint: {envpython} -m pylint --version
     pylint: {envpython} -m pylint src tests
-    format: {envpython} -m autopep8 -v -aa --in-place --recursive src
-    format: {envpython} -m autopep8 -v -aa --in-place --recursive tests
+    format: {envpython} -m autopep8 -v --max-line-length 88 -aa --in-place --recursive src
+    format: {envpython} -m autopep8 -v --max-line-length 88 -aa --in-place --recursive tests
     format: {envpython} -m black -v src tests
 
 [testenv:docs]
-- 
GitLab