Philipp Hörist pushed to branch master at gajim / gajim

Commits:

4 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -40,7 +40,7 @@ test-ruff:
    40 40
         - changes:
    
    41 41
           - "**/*.py"
    
    42 42
       script:
    
    43
    -    - pip3 install ruff==0.0.237
    
    43
    +    - pip3 install ruff==0.0.259
    
    44 44
         - ruff .
    
    45 45
       interruptible: true
    
    46 46
     
    

  • .pre-commit-config.yaml
    1 1
     repos:
    
    2 2
       - repo: https://github.com/charliermarsh/ruff-pre-commit
    
    3
    -    rev: v0.0.237
    
    3
    +    rev: v0.0.259
    
    4 4
         hooks:
    
    5 5
           - id: ruff
    
    6 6
             exclude: ".githooks/"
    

  • gajim/common/passwords.py
    ... ... @@ -57,7 +57,7 @@ def init(self) -> None:
    57 57
             for backend in backends:
    
    58 58
                 log.info('Found keyring backend: %s', backend)
    
    59 59
     
    
    60
    -        if (app.settings.get('enable_keepassxc_integration') and 
    
    60
    +        if (app.settings.get('enable_keepassxc_integration') and
    
    61 61
                     package_version('keyring>=23.8.1')):
    
    62 62
                 _keyring = keyring.get_keyring()
    
    63 63
                 self.backend = _keyring.with_properties(scheme='KeePassXC')
    

  • pyproject.toml
    ... ... @@ -198,7 +198,15 @@ ignore = [
    198 198
       "N806",   # Variable should be lower case
    
    199 199
       "N817",   # CamelCase imported as acronym
    
    200 200
       "N818",   # Exception name should be named with an Error suffix
    
    201
    +  "PLC1901",# Expression can be simplified to x as an empty string is falsey
    
    202
    +  "PLR0911",# Too many return statements
    
    203
    +  "PLR0912",# Too many branches
    
    204
    +  "PLR0913",# Too many arguments to function call
    
    205
    +  "PLR0915",# Too many statements
    
    201 206
       "PLR2004",# Magic value used in comparison, consider replacing x with a constant variable
    
    207
    +  "PLR5501",# Consider using `elif` instead of `else` then `if` to remove one indentation level
    
    208
    +  "PLW0603",# Using the global statement to update `x` is discouraged
    
    209
    +  "PLW2901",# `for` loop variable `x` overwritten by assignment target
    
    202 210
       "RUF001", # AmbiguousUnicodeCharacterString
    
    203 211
       "RUF002", # AmbiguousUnicodeCharacterDocstring
    
    204 212
       "RUF003", # AmbiguousUnicodeCharacterComment
    
    ... ... @@ -206,10 +214,17 @@ ignore = [
    206 214
       "RUF100", # Unused `noqa` directive
    
    207 215
       "S101",   # Use of `assert` detected
    
    208 216
       "S110",   # `try`-`except`-`pass` detected, consider logging the exception
    
    217
    +  "S301",   # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
    
    218
    +  "S303",   # Use of insecure MD2, MD4, MD5, or SHA1 hash function
    
    219
    +  "S310",   # Audit URL open for permitted schemes
    
    220
    +  "S311",   # Standard pseudo-random generators are not suitable for cryptographic purposes
    
    221
    +  "S314",   # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
    
    209 222
       "S324",   # Probable use of insecure hash functions
    
    223
    +  "S608",   # Possible SQL injection vector through string-based query construction
    
    210 224
       "SIM102", # Use a single `if` statement instead of nested `if` statements
    
    211 225
       "SIM105", # Use `contextlib.suppress(Exception)` instead of try-except-pass
    
    212 226
       "SIM108", # Use ternary operator
    
    227
    +  "SIM114", # Combine `if` branches using logical `or` operator"
    
    213 228
       "SIM115", # Use context handler for opening files
    
    214 229
       "SIM201", # Use x instead of not x
    
    215 230
       "SIM212", # Use `value if value else ''` instead of `'' if not value else value`
    
    ... ... @@ -219,6 +234,9 @@ ignore = [
    219 234
       "UP031",  # Use format specifiers instead of percent format
    
    220 235
       "UP032",  # Use f-string instead of `format` call
    
    221 236
       "UP034",  # Avoid extraneous parentheses
    
    237
    +  "UP035",  # Import from `collections.abc` instead: `Callable`
    
    238
    +  "UP038",  # Use `X | Y` in `isinstance` call instead of `(X, Y)`
    
    239
    +  "UP037",  # Remove quotes from type annotation
    
    222 240
     ]
    
    223 241
     
    
    224 242
     exclude = [