Skip to content

Commit

Permalink
Refactor CI, deps, bots (#127)
Browse files Browse the repository at this point in the history
* Realign project files

* Update project files

* Apply new ruff rules

* Apply ruff format

* Apply prettier reformat

* Apply yamllint

* Revoke exception changes

* Apply more ruff rules

* Update ci

* Add renovate

* Improve coverage

* Remove shebangs check

* Update license
  • Loading branch information
tb1337 authored Mar 8, 2024
1 parent 88154ff commit c8acd51
Show file tree
Hide file tree
Showing 82 changed files with 1,297 additions and 718 deletions.
9 changes: 0 additions & 9 deletions .codecov.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .devcontainer/Dockerfile.dev

This file was deleted.

97 changes: 56 additions & 41 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,58 @@
{
"name": "PyPaperless Dev",
"context": "..",
"dockerFile": "Dockerfile.dev",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"containerEnv": {
"DEVCONTAINER": "1"
},
"postCreateCommand": "script/setup",
"postStartCommand": "script/bootstrap",
"runArgs": ["-e", "GIT_EDITOR=code --wait"],
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
"ms-python.black-formatter",
"ms-python.pylint",
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"ms-python.mypy-type-checker"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.testing.pytestArgs": [
"--no-cov"
],
"python.testing.pytestEnabled": false,
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
}
"containerEnv": {
"DEVCONTAINER": "true",
"POETRY_VIRTUALENVS_IN_PROJECT": "true"
},
"customizations": {
"codespaces": {
"openFiles": ["README.md", "src/pypaperless/api.py"]
},
"vscode": {
"extensions": [
"ms-python.python",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"charliermarsh.ruff",
"GitHub.vscode-github-actions",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
}
},
"coverage-gutters.customizable.context-menu": true,
"coverage-gutters.customizable.status-bar-toggler-watchCoverageAndVisibleEditors-enabled": true,
"coverage-gutters.showGutterCoverage": true,
"coverage-gutters.showLineCoverage": true,
"coverage-gutters.xmlname": "coverage.xml",
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "ruff",
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestArgs": [
"--cov-report=xml"
],
"python.testing.pytestEnabled": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.interpreter": [".venv/bin/python"],
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12",
"installTools": false
}
},
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"name": "pypaperless Developer",
"updateContentCommand": ". ${NVM_DIR}/nvm.sh && nvm install && nvm use && npm install && poetry install && poetry run pre-commit install"
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 2

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text eol=lf
*.py whitespace=error
19 changes: 0 additions & 19 deletions .github/dependabot.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

exclude-labels:
- "skip-changelog"
Expand All @@ -14,7 +13,7 @@ categories:
- title: "✨ New features"
labels:
- "new-feature"
- title: "🐛 Bug Fixes"
- title: "🐛 Bug fixes"
labels:
- "bugfix"
- title: "🚀 Enhancements"
Expand Down Expand Up @@ -45,6 +44,7 @@ version-resolver:
patch:
labels:
- "bugfix"
- "ci"
- "dependencies"
- "enhancement"
- "performance"
Expand Down
48 changes: 48 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"schedule": ["before 2am"],
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": ["dependencies", "no-stale"],
"lockFileMaintenance": {
"enabled": true,
"automerge": true
},
"commitMessagePrefix": "⬆️",
"packageRules": [
{
"matchManagers": ["poetry"],
"addLabels": ["python"]
},
{
"matchManagers": ["poetry"],
"matchDepTypes": ["dev"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["poetry"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchManagers": ["npm", "nvm"],
"addLabels": ["javascript"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["npm", "nvm"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchManagers": ["github-actions"],
"addLabels": ["github_actions"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}
]
}
5 changes: 3 additions & 2 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Sync labels

# yamllint disable-line rule:truthy
on:
push:
branches:
Expand All @@ -14,9 +15,9 @@ jobs:
name: 🏷 Sync labels
runs-on: ubuntu-latest
steps:
- name: ⤵️ Checkout code
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run label sync
- name: 🚀 Run Label Syncer
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit c8acd51

Please sign in to comment.