Skip to content

Commit

Permalink
CI(deps): Update ruff to v0.7.0 (OSGeo#4544)
Browse files Browse the repository at this point in the history
* CI(deps): Update ruff to v0.7.0

* style: Fix FURB156: Use of hardcoded string charset

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
  • Loading branch information
renovate[bot] and echoix authored Oct 18, 2024
1 parent 37d4082 commit 3c67825
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# renovate: datasource=pypi depName=bandit
BANDIT_VERSION: "1.7.10"
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.6.9"
RUFF_VERSION: "0.7.0"

runs-on: ${{ matrix.os }}
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.9
rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import re
import inspect
import operator
from string import digits

from grass.script import core as grass
from grass.script import task as gtask
Expand Down Expand Up @@ -936,7 +937,7 @@ def SetAddOnPath(addonPath=None, key="PATH"):


def color_resolve(color):
if len(color) > 0 and color[0] in "0123456789":
if len(color) > 0 and color[0] in digits:
rgb = tuple(map(int, color.split(":")))
label = color
else:
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/goutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""

import textwrap
from string import digits

import wx
from wx import stc
Expand Down Expand Up @@ -624,7 +625,7 @@ def AddStyledMessage(self, message, style=None):
self.linePos = self.GetCurrentPos()
if c != " ":
last_c = c
if last_c not in ("0123456789"):
if last_c not in (digits):
self.AddTextWrapped("\n", wrap=None)
self.linePos = -1
else:
Expand Down
3 changes: 2 additions & 1 deletion python/grass/imaging/images2ims.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import os
from operator import itemgetter
from string import digits

try:
import numpy as np
Expand Down Expand Up @@ -117,7 +118,7 @@ def _getSequenceNumber(filename, part1, part2):
# Get all numeric chars
seq2 = ""
for c in seq:
if c in "0123456789":
if c in digits:
seq2 += c
else:
break
Expand Down
4 changes: 3 additions & 1 deletion scripts/d.rast.edit/d.rast.edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
import sys
import math
import atexit
from string import digits

import grass.script as gs

from grass.script.setup import set_gui_path
Expand Down Expand Up @@ -448,7 +450,7 @@ def OnClose(self, ev):

def OnReturn(self, ev):
self.app.brush = self.newval.GetValue()
if self.app.brush != "*" and self.app.brush.strip("0123456789") != "":
if self.app.brush != "*" and self.app.brush.strip(digits) != "":
self.app.brush = "*"
self.brush_update()

Expand Down

0 comments on commit 3c67825

Please sign in to comment.