INNER CODE UNIT · Python

noVerboseRedirectionFixer

asdf-vm/asdf · scripts/checkstyle.py:88

def noVerboseRedirectionFixer(line: str, m: Any) -> str:
    prestr, _, poststr = utilGetStrs(line, m)

    return f'{prestr}&>/dev/null{poststr}'

def lintfile(file: Path, rules: List[Rule], options: Dict[str, Any]):
    content_arr = file.read_text().split('\n')

    for line_i, line in enumerate(content_arr):
        if 'checkstyle-ignore' in line:
            continue

        for rule in rules:
            should_run = False
            if 'sh' in rule['fileTypes']:
                if file.name.endswith('.sh') or str(file.absolute()).endswith('bin/asdf'):
                    should_run = True
            if 'bash' in rule['fileTypes']:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…