Compare commits

..

No commits in common. "7f53b8aa564abe90b56570e4938c86dd48530586" and "742e00f24df6ecb43fec549cf0968e5977d755ba" have entirely different histories.

5 changed files with 46 additions and 77 deletions

View file

@ -1,51 +1,26 @@
# Pre-commit hooks to run tests and ensure code is cleaned.
# See https://pre-commit.com for more information
---
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--keep-percent-format", "--py37-plus"]
args: ['--keep-percent-format', '--py37-plus']
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.11.0
hooks:
- id: black
args: ["--target-version", "py37", "--line-length", "100"]
args: ['--target-version', 'py37', '--line-length', '100']
- repo: https://github.com/PyCQA/isort
rev: 5.11.5
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--line-length", "100"]
args: ['--profile', 'black', '--line-length', '100']
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args: ["--max-line-length=100"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
args:
- --ignore-words-list=fro,hass
- --skip="./.*,*.csv,*.json,*.ambr"
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
args: ['--max-line-length=100']
- repo: local
hooks:
- id: pylint
@ -54,14 +29,8 @@ repos:
language: system
types: [python]
require_serial: true
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
rev: v1.0.5
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: python-bandit-vulnerability-check
name: bandit
args: [--skip, "B101", --recursive, mylib]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: bandit
args: [--skip, "B101", --recursive, "mylib"]

View file

@ -3,7 +3,7 @@ clone:
image: woodpeckerci/plugin-git
tags: true
steps:
pipeline:
tests:
image: brenard/python-pre-commit:latest
commands:
@ -15,25 +15,24 @@ steps:
image: brenard/debian-python-deb
when:
event: tag
depends_on: [tests]
commands:
- echo "$GPG_KEY"|base64 -d|gpg --import
- ./build.sh --quiet
secrets: [ maintainer_name, maintainer_email, gpg_key, debian_codename ]
publish-dryrun:
group: publish
image: alpine
when:
event: tag
depends_on: [build]
commands:
- ls dist/* dist/check-forgejo-upgrade-*/check_forgejo_upgrade
publish-gitea:
group: publish
image: plugins/gitea-release
when:
event: tag
depends_on: [build]
settings:
api_key:
from_secret: gitea_token
@ -47,10 +46,10 @@ steps:
- sha512
publish-apt:
group: publish
image: brenard/aptly-publish
when:
event: tag
depends_on: [build]
settings:
api_url:
from_secret: apt_api_url

View file

@ -40,3 +40,4 @@ This program is free software; you can redistribute it and/or modify it under th
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

View file

@ -24,7 +24,7 @@ sed -i "s/^VERSION *=.*$/VERSION = '$VERSION'/" $BDIR/check_forgejo_upgrade
if [ -z "$DEBIAN_CODENAME" ]
then
echo "Retrieve debian codename using lsb_release..."
echo "Retreive debian codename using lsb_release..."
DEBIAN_CODENAME=$( lsb_release -c -s )
else
echo "Use debian codename from environment ($DEBIAN_CODENAME)"

View file

@ -55,7 +55,7 @@ logging.basicConfig(level=logging.DEBUG if options.debug else logging.WARNING)
CURRENT = None
cmd = [options.path, "--version"]
logging.debug("Command use to retrieve current version of Forgejo: %s", " ".join(cmd))
logging.debug("Command use to retreive current version of Forgejo: %s", " ".join(cmd))
OUTPUT = None
EXCEPTION = None
try:
@ -69,7 +69,7 @@ except Exception as err: # pylint: disable=broad-except
logging.debug("Current version: %s", CURRENT)
if not CURRENT:
print("UNKNOWN - Fail to retrieve current Forgejo")
print("UNKNOWN - Fail to retreive current Forgejo")
print(f'Command: {" ".join(cmd)}')
print("Output:")
print(OUTPUT if OUTPUT else "")
@ -85,7 +85,7 @@ LATEST_INT = None
try:
logging.debug("Get releases RSS feed from %s...", options.url)
r = requests.get(options.url, timeout=options.timeout)
logging.debug("Data retrieve:\n%s", r.text)
logging.debug("Data retreive:\n%s", r.text)
data = xmltodict.parse(r.text)
versions = {}
for item in data["rss"]["channel"]["item"]:
@ -111,7 +111,7 @@ except Exception: # pylint: disable=broad-except # nosec
logging.debug("Latest version: %s", LATEST)
if not LATEST:
print("UNKNOWN - Fail to retrieve latest Forgejo release from the project RSS feed")
print("UNKNOWN - Fail to retreive latest Forgejo release from the project RSS feed")
print(f"Current version: {CURRENT}")
sys.exit(3)