mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-05 15:59:16 -06:00
Small cleanups
This commit is contained in:
@@ -10,14 +10,12 @@ UNSET = collections.namedtuple('UNSET', ())()
|
||||
|
||||
|
||||
Var = collections.namedtuple('Var', ('name', 'default'))
|
||||
setattr(Var.__new__, '__defaults__', ('',))
|
||||
Var.__new__.__defaults__ = ('',)
|
||||
|
||||
|
||||
def format_env(parts, env):
|
||||
return ''.join(
|
||||
env.get(part.name, part.default)
|
||||
if isinstance(part, Var)
|
||||
else part
|
||||
env.get(part.name, part.default) if isinstance(part, Var) else part
|
||||
for part in parts
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user