🚨 Updated lints (#308)

This commit is contained in:
Nikhil Badyal
2023-08-25 15:36:50 +05:30
committed by GitHub
parent 09b815cb21
commit 77377cdd48
26 changed files with 404 additions and 487 deletions
+10 -9
View File
@@ -5,7 +5,7 @@ from environs import Env
from loguru import logger
from src.config import RevancedConfig
from src.exceptions import AppNotFound, PatchesJsonLoadFailed, PatchingFailed
from src.exceptions import AppNotFoundError, PatchesJsonLoadError, PatchingFailedError, UnknownError
from src.parser import Parser
from src.patches import Patches
from src.utils import check_java, extra_downloads
@@ -19,13 +19,14 @@ def main() -> None:
env.read_env()
config = RevancedConfig(env)
extra_downloads(config)
check_java(config.dry_run)
if not config.dry_run:
check_java()
logger.info(f"Will Patch only {config.apps}")
for app in config.apps:
logger.info(f"Trying to build {app}")
for possible_app in config.apps:
logger.info(f"Trying to build {possible_app}")
try:
app = APP(app_name=app, config=config)
app = APP(app_name=possible_app, config=config)
patcher = Patches(config, app)
parser = Parser(patcher, config)
app_all_patches = patcher.get_app_configs(app)
@@ -33,13 +34,13 @@ def main() -> None:
patcher.include_exclude_patch(app, parser, app_all_patches)
logger.info(app)
parser.patch_app(app)
except AppNotFound as e:
except AppNotFoundError as e:
logger.info(e)
except PatchesJsonLoadFailed:
except PatchesJsonLoadError:
logger.exception("Patches.json not found")
except PatchingFailed as e:
except PatchingFailedError as e:
logger.exception(e)
except Exception as e:
except UnknownError as e:
logger.exception(f"Failed to build {app} because of {e}")