mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-11 05:44:16 +00:00
Rename variable names
This commit is contained in:
parent
0a8b929f07
commit
2b28f4f051
1 changed files with 7 additions and 12 deletions
|
|
@ -6,28 +6,23 @@ import sys
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class CLIOption(Enum):
|
class LineEnding(Enum):
|
||||||
def __init__(self, optName):
|
|
||||||
self.optName = optName
|
|
||||||
|
|
||||||
|
|
||||||
class LineEnding(CLIOption):
|
|
||||||
CR = '\r', '\\r', 'cr', re.compile(r'\r', re.DOTALL)
|
CR = '\r', '\\r', 'cr', re.compile(r'\r', re.DOTALL)
|
||||||
CRLF = '\r\n', '\\r\\n', 'crlf', re.compile(r'\r\n', re.DOTALL)
|
CRLF = '\r\n', '\\r\\n', 'crlf', re.compile(r'\r\n', re.DOTALL)
|
||||||
LF = '\n', '\\n', 'lf', re.compile(r'(?<!\r)\n', re.DOTALL)
|
LF = '\n', '\\n', 'lf', re.compile(r'(?<!\r)\n', re.DOTALL)
|
||||||
|
|
||||||
def __init__(self, string, strPrint, optName, regex):
|
def __init__(self, string, str_print, opt_name, regex):
|
||||||
self.string = string
|
self.string = string
|
||||||
self.strPrint = strPrint
|
self.str_print = str_print
|
||||||
self.optName = optName
|
self.opt_name = opt_name
|
||||||
self.regex = regex
|
self.regex = regex
|
||||||
|
|
||||||
|
|
||||||
class MixedLineEndingOption(CLIOption):
|
class MixedLineEndingOption(Enum):
|
||||||
AUTO = 'auto', None
|
AUTO = 'auto', None
|
||||||
NO = 'no', None
|
NO = 'no', None
|
||||||
CRLF = LineEnding.CRLF.optName, LineEnding.CRLF
|
CRLF = LineEnding.CRLF.opt_name, LineEnding.CRLF
|
||||||
LF = LineEnding.LF.optName, LineEnding.LF
|
LF = LineEnding.LF.opt_name, LineEnding.LF
|
||||||
|
|
||||||
def __init__(self, opt_name, line_ending_enum):
|
def __init__(self, opt_name, line_ending_enum):
|
||||||
self.opt_name = opt_name
|
self.opt_name = opt_name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue