Skip to content

Conversation

gaelicWizard
Copy link
Contributor

@gaelicWizard gaelicWizard commented Sep 19, 2021

Description

Adopt _command_exists, quote variables, handle unbound parameters, code flow simplification.

Motivation and Context

This was part of my _command_exists branch (#1938) but was out of scope.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@gaelicWizard gaelicWizard changed the title DRAFT: plugin/less-pretty-cat improvements plugin/less-pretty-cat improvements Sep 20, 2021
@gaelicWizard gaelicWizard marked this pull request as ready for review September 20, 2021 05:20
Copy link
Contributor

@davidpfarrell davidpfarrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greetings all !

I have a few comments, many related to the core logic and not necessarily this PR

However : WHY ARE THERE 7 EMPTY FILES IN THIS PR?

If this is chained and waiting on another PR, let's mark it as a DRAFT until its ready.

@gaelicWizard gaelicWizard force-pushed the plugin-less-pretty-cat branch 3 times, most recently from fc8c2b9 to 5d9c97a Compare September 22, 2021 20:31
@gaelicWizard
Copy link
Contributor Author

Rebased on master

Copy link
Contributor

@davidpfarrell davidpfarrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good I think we're almost there !

Addresses Bash-it#1632

Alsö, code style cleanup: quote variables, handle unbound parameters,  &c.
Convert from indented if-block to return then unindented code. This should have basically one line change at the top, one line removed at the bottom, and then all whitespace.
Copy link
Contributor

@davidpfarrell davidpfarrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets move this one along ...

one last note: On cless, although the docs mention a single file, the code actually cats ALL files and then pipes the result to less. I'm not going to hold up the PR on that but just wanted to call it out ...

The logic to run `cat` if `pygmentize` fails seems useless, so just remove it.
@gaelicWizard
Copy link
Contributor Author

Lets move this one along ...

one last note: On cless, although the docs mention a single file, the code actually cats ALL files and then pipes the result to less. I'm not going to hold up the PR on that but just wanted to call it out ...

tweaked and pushed 👍

@NoahGorny NoahGorny merged commit 127cbbd into Bash-it:master Sep 28, 2021
@gaelicWizard gaelicWizard deleted the plugin-less-pretty-cat branch September 29, 2021 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants