Skip to content
Snippets Groups Projects

tests: str(datafiles) instead of a longer thing

Merged Angelos Evripiotis requested to merge aevri/dirname_basename into master
All threads resolved!

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)'
Edited by Angelos Evripiotis

Merge request reports

Pipeline #52976103 passed

Pipeline passed for f2b15d86 on aevri/dirname_basename

Test coverage 86.83% (0.00%) from 1 job

Merged by bst-marge-botbst-marge-bot 6 years ago (Mar 21, 2019 3:55pm UTC)

Loading

Pipeline #52988212 failed

Pipeline failed for 7b8c730e on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading