Skip to content
  • Angelos Evripiotis's avatar
    tests: str(datafiles) instead of a longer thing · f2b15d86
    Angelos Evripiotis authored and bst-marge-bot's avatar bst-marge-bot committed
    Replace some popular copypasta.
    
    This important-looking invocation:
    
        os.path.join(datafiles.dirname, datafiles.basename)
    
    is equivalent to this shorter invocation:
    
        project = str(datafiles)
    
    It seems like it's very popular copypasta, replace it with the shorter
    one thus:
    
        # Use 'gsed' or 'sed' etc. as appropriate for your system.
        git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f'
        git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
    f2b15d86