mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +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
|
||||
|
||||
|
||||
class CLIOption(Enum):
|
||||
def __init__(self, optName):
|
||||
self.optName = optName
|
||||
|
||||
|
||||
class LineEnding(CLIOption):
|
||||
class LineEnding(Enum):
|
||||
CR = '\r', '\\r', 'cr', re.compile(r'\r', 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)
|
||||
|
||||
def __init__(self, string, strPrint, optName, regex):
|
||||
def __init__(self, string, str_print, opt_name, regex):
|
||||
self.string = string
|
||||
self.strPrint = strPrint
|
||||
self.optName = optName
|
||||
self.str_print = str_print
|
||||
self.opt_name = opt_name
|
||||
self.regex = regex
|
||||
|
||||
|
||||
class MixedLineEndingOption(CLIOption):
|
||||
class MixedLineEndingOption(Enum):
|
||||
AUTO = 'auto', None
|
||||
NO = 'no', None
|
||||
CRLF = LineEnding.CRLF.optName, LineEnding.CRLF
|
||||
LF = LineEnding.LF.optName, LineEnding.LF
|
||||
CRLF = LineEnding.CRLF.opt_name, LineEnding.CRLF
|
||||
LF = LineEnding.LF.opt_name, LineEnding.LF
|
||||
|
||||
def __init__(self, opt_name, line_ending_enum):
|
||||
self.opt_name = opt_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue