Print warnings when builds are deselected because of build OS

This commit is contained in:
Joe Rickerby
2021-01-05 14:29:38 +00:00
parent 46eb28791f
commit e405f3495e
3 changed files with 47 additions and 5 deletions
+14
View File
@@ -229,3 +229,17 @@ def detect_ci_provider() -> Optional[CIProvider]:
return CIProvider.other
else:
return None
def wrap_text(text: str, max_width: int = 80) -> str:
'''
Formats text, suitable for printing arbitrary long passages to console.
'''
# remove initial line indent
text = textwrap.dedent(text)
# remove leading/trailing whitespace
text = text.strip()
# remove consecutive whitespace
text = re.sub(r'\s+', ' ', text)
# wrap to max_width
return '\n'.join(textwrap.wrap(text, width=max_width))