mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Set line length to 120 characters (#2599)
This commit is contained in:
@@ -73,18 +73,12 @@ types = {
|
||||
"class": (
|
||||
":class:`" + attributeClassType + "`",
|
||||
None,
|
||||
"self._makeClassAttribute("
|
||||
+ attributeClassType
|
||||
+ ', attributes["'
|
||||
+ attributeName
|
||||
+ '"])',
|
||||
"self._makeClassAttribute(" + attributeClassType + ', attributes["' + attributeName + '"])',
|
||||
attributeClassType,
|
||||
),
|
||||
}
|
||||
|
||||
attributeDocType, attributeAssertType, attributeValue, attributeClassType = types[
|
||||
attributeType
|
||||
]
|
||||
attributeDocType, attributeAssertType, attributeValue, attributeClassType = types[attributeType]
|
||||
if attributeType == "class":
|
||||
# Wrap in quotes to avoid an explicit import requirement which can cause circular import errors
|
||||
attributeClassType = f"'{attributeClassType}'"
|
||||
@@ -114,21 +108,15 @@ while not added:
|
||||
elif line.startswith(" def "):
|
||||
attrName = line[8:-7]
|
||||
# Properties will be inserted after __repr__, but before any other function.
|
||||
if attrName != "__repr__" and (
|
||||
attrName == "_identity" or attrName > attributeName or not isProperty
|
||||
):
|
||||
if attrName != "__repr__" and (attrName == "_identity" or attrName > attributeName or not isProperty):
|
||||
if not isProperty:
|
||||
newLines.append(" @property")
|
||||
newLines.append(
|
||||
" def " + attributeName + "(self) -> " + attributeClassType + ":"
|
||||
)
|
||||
newLines.append(" def " + attributeName + "(self) -> " + attributeClassType + ":")
|
||||
newLines.append(' """')
|
||||
newLines.append(" :type: " + attributeDocType)
|
||||
newLines.append(' """')
|
||||
if isCompletable:
|
||||
newLines.append(
|
||||
" self._completeIfNotSet(self._" + attributeName + ")"
|
||||
)
|
||||
newLines.append(" self._completeIfNotSet(self._" + attributeName + ")")
|
||||
newLines.append(" return self._" + attributeName + ".value")
|
||||
newLines.append("")
|
||||
if isProperty:
|
||||
@@ -150,9 +138,7 @@ while not added:
|
||||
if line:
|
||||
attrName = line[14:-29]
|
||||
if not line or attrName > attributeName:
|
||||
newLines.append(
|
||||
" self._" + attributeName + " = github.GithubObject.NotSet"
|
||||
)
|
||||
newLines.append(" self._" + attributeName + " = github.GithubObject.NotSet")
|
||||
added = True
|
||||
newLines.append(line)
|
||||
|
||||
@@ -172,11 +158,7 @@ while not added:
|
||||
if line:
|
||||
attrName = line[12:-36]
|
||||
if not line or attrName > attributeName:
|
||||
newLines.append(
|
||||
' if "'
|
||||
+ attributeName
|
||||
+ '" in attributes: # pragma no branch'
|
||||
)
|
||||
newLines.append(' if "' + attributeName + '" in attributes: # pragma no branch')
|
||||
if attributeAssertType:
|
||||
newLines.append(
|
||||
' assert attributes["'
|
||||
@@ -189,9 +171,7 @@ while not added:
|
||||
+ attributeName
|
||||
+ '"]'
|
||||
)
|
||||
newLines.append(
|
||||
" self._" + attributeName + " = " + attributeValue
|
||||
)
|
||||
newLines.append(" self._" + attributeName + " = " + attributeValue)
|
||||
added = True
|
||||
newLines.append(line)
|
||||
|
||||
|
||||
@@ -112,11 +112,7 @@ class PythonHeader:
|
||||
|
||||
if len(bodyLines) > 0 and bodyLines[0] != "":
|
||||
newLines.append("")
|
||||
if (
|
||||
"import " not in bodyLines[0]
|
||||
and bodyLines[0] != '"""'
|
||||
and not bodyLines[0].startswith("##########")
|
||||
):
|
||||
if "import " not in bodyLines[0] and bodyLines[0] != '"""' and not bodyLines[0].startswith("##########"):
|
||||
newLines.append("")
|
||||
newLines += bodyLines
|
||||
|
||||
|
||||
Reference in New Issue
Block a user