mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
improve output message with auto-fix
This commit is contained in:
parent
ca223c7f0c
commit
6452ae7f9a
@ -97,7 +97,10 @@ class Check(Command):
|
|||||||
|
|
||||||
def perform_auto_fix(self):
|
def perform_auto_fix(self):
|
||||||
p = subprocess.Popen(['ruff', 'check', '--fix-only'], text=True, stdout=subprocess.PIPE)
|
p = subprocess.Popen(['ruff', 'check', '--fix-only'], text=True, stdout=subprocess.PIPE)
|
||||||
return p.stdout.read()
|
msg = p.stdout.read().strip()
|
||||||
|
if not msg:
|
||||||
|
msg = 'Fixed 0 error.'
|
||||||
|
return msg
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
self.fhash_cache = {}
|
self.fhash_cache = {}
|
||||||
@ -113,7 +116,7 @@ class Check(Command):
|
|||||||
if opts.fix:
|
if opts.fix:
|
||||||
self.info('\tAuto-fixing')
|
self.info('\tAuto-fixing')
|
||||||
msg = self.perform_auto_fix()
|
msg = self.perform_auto_fix()
|
||||||
self.info(msg)
|
self.info(msg+'\n')
|
||||||
dirty_files = tuple(f for f in self.get_files() if not self.is_cache_valid(f, cache))
|
dirty_files = tuple(f for f in self.get_files() if not self.is_cache_valid(f, cache))
|
||||||
try:
|
try:
|
||||||
for i, f in enumerate(dirty_files):
|
for i, f in enumerate(dirty_files):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user