feat: add preset skip flag
This commit is contained in:
@@ -3,11 +3,11 @@ conditions = ["file(package.json)"]
|
||||
|
||||
[presets.nodejs.tasks.setup.npm]
|
||||
conditions = ["file(package-lock.json)"]
|
||||
commands = ["npm install-clean --legacy-peer-deps"]
|
||||
commands = ["npm install-clean"]
|
||||
|
||||
[presets.nodejs.tasks.setup.npm-legacy]
|
||||
conditions = ["file(package-lock.json) | not"]
|
||||
commands = ["npm install --legacy-peer-deps"]
|
||||
commands = ["npm install"]
|
||||
|
||||
[presets.nodejs.tasks.test.jest]
|
||||
conditions = ["file(node_modules/jest)"]
|
||||
|
||||
@@ -28,7 +28,7 @@ commands = ["poetry publish -r {python_repository}"]
|
||||
|
||||
[presets.python.tasks.test.pytest]
|
||||
conditions = ["file(.venv/bin/pytest)"]
|
||||
commands = [".venv/bin/pytest -p no:warnings"]
|
||||
commands = [".venv/bin/python -m pytest"]
|
||||
|
||||
[presets.python.tasks.lint.isort]
|
||||
conditions = ["file(.venv/bin/isort)"]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from cmath import pi
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
@@ -19,6 +18,8 @@ class PresetEntryDetector(EntryDetector):
|
||||
|
||||
def detect_entry(self, basepath: Path) -> Optional["Entry"]:
|
||||
preset = PresetResolver(basepath, self._preset_resolver_config).resolve_preset()
|
||||
if preset.skip:
|
||||
return
|
||||
piperunner = PipeRunner(basepath)
|
||||
tasks = defaultdict(list)
|
||||
for preset_name, preset in preset.presets.items():
|
||||
|
||||
@@ -2,7 +2,11 @@ from typing import Dict, List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
__all__ = ("TaskPreset", "EntryPreset", "Preset")
|
||||
__all__ = (
|
||||
"TaskPreset",
|
||||
"EntryPreset",
|
||||
"Preset",
|
||||
)
|
||||
|
||||
|
||||
class TaskPreset(BaseModel):
|
||||
@@ -17,4 +21,5 @@ class EntryPreset(BaseModel):
|
||||
|
||||
|
||||
class Preset(BaseModel):
|
||||
skip: Optional[bool]
|
||||
presets: Dict[str, EntryPreset]
|
||||
|
||||
Reference in New Issue
Block a user