Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean barbuk theme #1766

Merged
merged 5 commits into from
Jan 7, 2021
Merged

Clean barbuk theme #1766

merged 5 commits into from
Jan 7, 2021

Conversation

BarbUk
Copy link
Contributor

@BarbUk BarbUk commented Jan 6, 2021

Description

Add barbuk theme to clean_files.txt.
shfmt lint only.

Copy link
Member

@cornfeedhobo cornfeedhobo left a comment

Choose a reason for hiding this comment

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

@NoahGorny Heads up; this is the 3rd PR that I've had to re-run the mac 11 job. I'll probably reach out to github support if this persists, but for now, I recommend re-running actions if that's the only failing job.

@BarbUk Looks like you figured out the bug I ran into; shfmt must be run a few times to catch all the whitespace issues. I'm reaching out to the owner of shfmt to try and figure it out. Thanks so much for sticking with this!

I have verified no code changes using shfmt and diff locally. Approved.

Edit: @NoahGorny After you take a look, I'd recommend Squashing this merge.

@BarbUk
Copy link
Contributor Author

BarbUk commented Jan 7, 2021

@BarbUk Looks like you figured out the bug I ran into; shfmt must be run a few times to catch all the whitespace issues.

Yes.

What's strange is that pre-commit is telling me that everything is fine, but running shfmt change the file.

For example, from the current master:

~/.dotfiles/modules/bash-it on  master ⤏  origin •1 ✗ ❯ git diff
──────────────────────
modified: clean_files.txt
──────────────────────
@ clean_files.txt:30 @ lint_clean_files.sh
#
themes/90210
themes/powerline
themes/barbuk

# plugins
#~/.dotfiles/modules/bash-it on  master ⤏  origin •1 ✗ ❯ pre-commit run --files `cat clean_files.txt`
Trim Trailing Whitespace....................................................Passed
Fix End of Files............................................................Passed
Check for merge conflicts...................................................Passed
Mixed line ending...........................................................Passed
Check for added large files.................................................Passed
Check for conflict markers and core.whitespace errors.......................Passed
Test shell scripts with shellcheck..........................................Passed
Check shell style with shfmt................................................Passed
CRLF end-lines remover......................................................Passed

   ~/.dotfiles/modules/bash-it on  master ⤏  origin •1 ✗  1.1s ❯ shfmt -w themes/barbuk/barbuk.theme.bash 

   ~/.dotfiles/modules/bash-it on  master ⤏  origin •2 ✗  2.0s ❯ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   clean_files.txt
	modified:   themes/barbuk/barbuk.theme.bash

no changes added to commit (use "git add" and/or "git commit -a")

@davidpfarrell
Copy link
Contributor

HI All - This is a drive-by comment, I have not deeply reviewed the situation, but I noticed:

❯ pre-commit run --files `cat clean_files.txt`

This is likely not going to do what you think it will ... I don't believe that pre-commit will traverse directories given in the clean_files.txt file.

That's whylint_clean_files.sh actually has logic to traverse the directories and build a file-only list which is passed to pre-commit.

Try running ./lint_clean_files.sh instead of invoking pre-commit directly.

@NoahGorny
Copy link
Member

Well done @BarbUk, and thanks for the review @cornfeedhobo @davidpfarrell !

@NoahGorny NoahGorny merged commit ae9da3b into Bash-it:master Jan 7, 2021
@BarbUk BarbUk deleted the clean/theme_barbuk branch January 8, 2021 11:37
@BarbUk
Copy link
Contributor Author

BarbUk commented Jan 8, 2021

Try running ./lint_clean_files.sh instead of invoking pre-commit directly.

This is the correct solution, thanks.

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.

None yet

4 participants