Skip to content

Commit

Permalink
fix[pipeline]: add ruff remove flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
mak626 committed Nov 21, 2023
1 parent cad8b76 commit e5fd8df
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
pip install ruff
- name: Lint with ruff
run: make lint
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ clean:
@find . -name "__pycache__" -delete

lint:
@flake8 graphene_mongo --count --show-source --statistics
@ruff check graphene_mongo
@ruff format . --check

test: clean
pytest graphene_mongo/tests --cov=graphene_mongo --cov-report=html --cov-report=term
Expand Down
2 changes: 1 addition & 1 deletion graphene_mongo/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def chained_resolver(self, resolver, is_partial, root, info, **args):
operation = list(arg.keys())[0]
args_copy["pk" + operation.replace("$", "__")] = arg[operation]
if not isinstance(arg, ObjectId) and "." in arg_name:
if type(arg) == dict:
if isinstance(arg, dict):
operation = list(arg.keys())[0]
args_copy[
arg_name.replace(".", "__") + operation.replace("$", "__")
Expand Down
2 changes: 1 addition & 1 deletion graphene_mongo/fields_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ async def chained_resolver(self, resolver, is_partial, root, info, **args):
operation = list(arg.keys())[0]
args_copy["pk" + operation.replace("$", "__")] = arg[operation]
if not isinstance(arg, ObjectId) and "." in arg_name:
if type(arg) == dict:
if isinstance(arg, dict):
operation = list(arg.keys())[0]
args_copy[
arg_name.replace(".", "__") + operation.replace("$", "__")
Expand Down
2 changes: 1 addition & 1 deletion graphene_mongo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def collect_query_fields(node, fragments):

field = {}
selection_set = None
if type(node) == dict:
if isinstance(node, dict):
selection_set = node.get("selection_set")
else:
selection_set = node.selection_set
Expand Down
52 changes: 1 addition & 51 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ asgiref = "^3.6.0"
pytest = "*"
mongomock = ">=4.1.2"
mock = ">=5.0.1"
flake8 = "*"
pytest-cov = "*"
pytest-asyncio = "^0.21.0"
ruff = "^0.1.6"
Expand Down

0 comments on commit e5fd8df

Please sign in to comment.