From 421498144425f518cd1a25d3608d0967c589a293 Mon Sep 17 00:00:00 2001 From: Daniel Gallagher Date: Thu, 24 May 2018 22:51:32 -0700 Subject: [PATCH] Add requirements-txt-fixer pre-commit hook and run on all files --- .pre-commit-config.yaml | 1 + UPGRADE-v2.0.md | 10 +++++----- docs/requirements.txt | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6bb6ee3..17f9dcd0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,3 +15,4 @@ - id: pretty-format-json args: - --autofix + - id: requirements-txt-fixer diff --git a/UPGRADE-v2.0.md b/UPGRADE-v2.0.md index 96aac143..5dc76154 100644 --- a/UPGRADE-v2.0.md +++ b/UPGRADE-v2.0.md @@ -207,7 +207,7 @@ Before: ```python class SomeMutation(Mutation): ... - + @classmethod def mutate(cls, instance, args, context, info): ... @@ -218,7 +218,7 @@ With 2.0: ```python class SomeMutation(Mutation): ... - + def mutate(self, info, **args): ... ``` @@ -231,7 +231,7 @@ class SomeMutation(Mutation): first_name = String(required=True) last_name = String(required=True) ... - + def mutate(self, info, first_name, last_name): ... ``` @@ -250,7 +250,7 @@ If you are using Middelwares, you need to some adjustments: Before: ```python -class MyGrapheneMiddleware(object): +class MyGrapheneMiddleware(object): def resolve(self, next_mw, root, args, context, info): ## Middleware code @@ -261,7 +261,7 @@ class MyGrapheneMiddleware(object): With 2.0: ```python -class MyGrapheneMiddleware(object): +class MyGrapheneMiddleware(object): def resolve(self, next_mw, root, info, **args): context = info.context diff --git a/docs/requirements.txt b/docs/requirements.txt index b6e0cd75..8cbfd6f5 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -# Required library -Sphinx==1.5.3 # Docs template http://graphene-python.org/sphinx_graphene_theme.zip +# Required library +Sphinx==1.5.3