Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ jobs:
skip-existing: true
verbose: true
print-hash: true

25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.25.0"
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
hooks:
- id: ruff-check
name: ruff check
args: ["--fix"]
- id: ruff-format
name: ruff format
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,3 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
def get_version():
version_file = open("django_prometheus/__init__.py").read()
version_match = re.search(
r'^__version__ = [\'"]([^\'"]*)[\'"]', version_file, re.MULTILINE
r'^__version__ = [\'"]([^\'"]*)[\'"]',
version_file,
re.MULTILINE,
)
if version_match:
return version_match.group(1)
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ commands =

[testenv:py39-lint]
deps =
ruff==0.11.13
pre-commit==4.2.0
commands =
ruff format --check django_prometheus/
ruff check django_prometheus/
pre-commit run --all-files
4 changes: 2 additions & 2 deletions update_version_from_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
git symbolic-ref -q --short HEAD || git describe --tags --exact-match
"""

import io
import re
import subprocess
import sys
Expand Down Expand Up @@ -125,5 +124,6 @@ def release_version_correct():
else:
print(
"Invalid usage. Supply 0 or 1 arguments. "
"Argument can be either a version '1.2.3' or 'patch' if you want to increase the patch-version (1.2.3 -> 1.2.4.dev)"
"Argument can be either a version '1.2.3' or 'patch' "
"if you want to increase the patch-version (1.2.3 -> 1.2.4.dev)"
)