Skip to content

Commit

Permalink
ruff for linting instead of flake8.
Browse files Browse the repository at this point in the history
  • Loading branch information
SAMAD101 committed Apr 5, 2024
1 parent b375d51 commit 49a3437
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python-version: 3.11
pre-commit: true

- name: Test formatting with Flake8, ruff and Black
- name: Test formatting with ruff and Black
shell: bash
run: make lint

Expand Down
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ repos:
# py39,
# ]

# check pep8 conformity using flake8
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

# configuration for the pre-commit.ci bot
# only relevant when actually using the bot
ci:
Expand Down
Empty file removed bin/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion requirements.d/dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
black==22.*
coverage
flake8
macholib
nox
pkgconfig
Expand Down
2 changes: 2 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
line-length = 120
exclude = ["build", "dist", ".git", ".idea", ".cache", ".tox", ".eggs", "./src/vorta/__init__.py", ".direnv", "env"]
16 changes: 4 additions & 12 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,8 @@ source = vorta
omit = tests/*
relative_files = true

[flake8]
ignore =
max-line-length = 120
extend-ignore = E203,E121,E123,E126,E226,E24,E704,W503,W504
exclude =
build,dist,.git,.idea,.cache,.tox,.eggs,
./src/vorta/__init__.py,.direnv,env

[tox:tox]
envlist = py36,py37,py38,flake8
envlist = py36,py37,py38,ruff
skip_missing_interpreters = true

[testenv]
Expand All @@ -92,10 +84,10 @@ deps =
commands=pytest
passenv = DISPLAY

[testenv:flake8]
[testenv:ruff]
deps =
flake8
commands=flake8 src tests
ruff
commands=ruff check src tests

[pycodestyle]
max_line_length = 120
Expand Down
10 changes: 6 additions & 4 deletions src/vorta/keyring/darwin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa
# ruff: noqa

"""
A dirty objc implementation to access the macOS Keychain. Because the
Expand All @@ -10,8 +10,10 @@
import logging
import sys
from ctypes import c_char

import objc
from Foundation import NSBundle

from .abc import VortaKeyring

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -47,14 +49,14 @@ def _set_keychain(self):

objc.loadBundleFunctions(Security, globals(), S_functions)

SecKeychainRef = objc.registerCFSignature('SecKeychainRef', b'^{OpaqueSecKeychainRef=}', SecKeychainGetTypeID())
SecKeychainItemRef = objc.registerCFSignature(
objc.registerCFSignature('SecKeychainRef', b'^{OpaqueSecKeychainRef=}', SecKeychainGetTypeID())
objc.registerCFSignature(
'SecKeychainItemRef',
b'^{OpaqueSecKeychainItemRef=}',
SecKeychainItemGetTypeID(),
)

PassBuffRef = objc.createOpaquePointerType('PassBuffRef', b'^{OpaquePassBuff=}', None)
objc.createOpaquePointerType('PassBuffRef', b'^{OpaquePassBuff=}', None)

# Get the login keychain
result, login_keychain = SecKeychainOpen(b'login.keychain', None)
Expand Down

0 comments on commit 49a3437

Please sign in to comment.