mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 00:09:45 +03:00
Address pylint issues.
This commit is contained in:
parent
9e408b385a
commit
c012c48866
|
@ -4,10 +4,10 @@ import re
|
||||||
def to_camel_case(snake_str):
|
def to_camel_case(snake_str):
|
||||||
"""
|
"""
|
||||||
Return a camel-cased version of a snake-cased string.
|
Return a camel-cased version of a snake-cased string.
|
||||||
|
|
||||||
Leading underscores and multiple-underscores are kept
|
Leading underscores and multiple-underscores are kept
|
||||||
intact.
|
intact.
|
||||||
|
|
||||||
:param snake_str: A snake-cased string.
|
:param snake_str: A snake-cased string.
|
||||||
:return: A camel-cased string.
|
:return: A camel-cased string.
|
||||||
"""
|
"""
|
||||||
|
@ -29,11 +29,12 @@ def to_camel_case(snake_str):
|
||||||
camel_case_sub_strings.append(s)
|
camel_case_sub_strings.append(s)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Otherwise replace '_name' with 'Name', for example.
|
# Otherwise we replace '_name' with 'Name', for example.
|
||||||
camel_case_sub_strings.append(s[1:].title())
|
camel_case_sub_strings.append(s[1:].title())
|
||||||
|
|
||||||
return ''.join(camel_case_sub_strings)
|
return ''.join(camel_case_sub_strings)
|
||||||
|
|
||||||
|
|
||||||
# From this response in Stackoverflow
|
# From this response in Stackoverflow
|
||||||
# http://stackoverflow.com/a/1176023/1072990
|
# http://stackoverflow.com/a/1176023/1072990
|
||||||
def to_snake_case(name):
|
def to_snake_case(name):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user