Switch to using run_process() instead of execute() in rbtools.hooks

Review Request #13426 — Created Nov. 21, 2023 and submitted

Information

RBTools
release-5.x

Reviewers

Since we're deprecating the rbtools.hooks.common.execute(), this change
switches over to using rbtools.utils.process.run_process() instead in our
rbtools.hooks module.

Ran the git-hook-check-approval hook, saw that it worked correctly.

Summary ID
Switch to using run_process() instead of execute() in rbtools.hooks
17b5dc1e79fa07890c8abea53346952d7fdf3c55
Description From Last Updated

A good pattern for these more complex statements (especially when they span lines) is to chain them: branches = ( …

chipx86chipx86

Along the lines of my older comment, I think for all run_process() calls, we should use the chain form. This …

chipx86chipx86
chipx86
  1. 
      
  2. rbtools/hooks/git.py (Diff revision 1)
     
     
     
    Show all issues

    A good pattern for these more complex statements (especially when they span lines) is to chain them:

    branches = (
        run_process(git_command)
        .stdout
        .read()
        .replace('*', '')
        .split('\n')
    )
    

    This is what the other call sites all use.

  3. 
      
maubin
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. rbtools/hooks/git.py (Diff revision 2)
     
     
    Show all issues

    Along the lines of my older comment, I think for all run_process() calls, we should use the chain form. This is a bit more readable and easier to augment.

  3. 
      
maubin
david
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (3792ad8)