tasks/test.py
def lint_filenames(ctx):
    """
    Scan files to ensure there are no filenames too long or containing illegal characters
    """
    files = ctx.run("git ls-files -z", hide=True).stdout.split("\0")
    failure = False

    if sys.platform == 'win32':
        print("Running on windows, no need to check filenames for illegal characters")
    else:
        print("Checking filenames for illegal characters")
        forbidden_chars = '<>:"\\|?*'
        for file in files:
            if any(char in file for char in forbidden_chars):
                print(f"Error: Found illegal character in path {file}")
                failure = True

    print("Checking filename length")
    # Approximated length of the prefix of the repo during the windows release build
    prefix_length = 160
    # Maximum length supported by the win32 API
    max_length = 255
    for file in files:
        if not file.startswith('test/kitchen/') and prefix_length + len(file) > max_length:
            print(f"Error: path {file} is too long ({prefix_length + len(file) - max_length} characters too many)")
            failure = True

    if failure:
        raise Exit(code=1)

    Scan files to ensure there are no filenames too long or containing illegal characters
    
Scan files to ensure there are no filenames too long or containing illegal characters
Scan files to ensure there are no filenames too long or containing illegal characters
def lint_filenames(ctx):
    files = ctx.run("git ls-files -z", hide=True).stdout.split("\0")
    failure = False
    if sys.platform == 'win32':
        print("Running on windows, no need to check filenames for illegal characters")
    else:
        print("Checking filenames for illegal characters")
        forbidden_chars = '<>:"\\|?*'
        for file in files:
            if any(char in file for char in forbidden_chars):
                print(f"Error: Found illegal character in path {file}")
                failure = True
    print("Checking filename length")
    prefix_length = 160
    max_length = 255
    for file in files:
        if not file.startswith('test/kitchen/') and prefix_length + len(file) > max_length:
            print(f"Error: path {file} is too long ({prefix_length + len(file) - max_length} characters too many)")
            failure = True
    if failure:
        raise Exit(code=1)
def lint_filenames ( ctx ) : files = ctx . run ( "git ls-files -z" , hide = True ) . stdout . split ( "\0" ) failure = False if sys . platform == 'win32' : print ( "Running on windows, no need to check filenames for illegal characters" ) else : print ( "Checking filenames for illegal characters" ) forbidden_chars = '<>:"\\|?*' for file in files : if any ( char in file for char in forbidden_chars ) : print ( f"Error: Found illegal character in path {file}" ) failure = True print ( "Checking filename length" ) prefix_length = 160 max_length = 255 for file in files : if not file . startswith ( 'test/kitchen/' ) and prefix_length + len ( file ) > max_length : print ( f"Error: path {file} is too long ({prefix_length + len(file) - max_length} characters too many)" ) failure = True if failure : raise Exit ( code = 1 )
Scan files to ensure there are no filenames too long or containing illegal characters
Scan files to ensure there are no filenames too long or containing illegal characters
"""
    Scan files to ensure there are no filenames too long or containing illegal characters
    """ # Approximated length of the prefix of the repo during the windows release build # Maximum length supported by the win32 API
ctx