Skip to content

Conversation

whiteh0rse
Copy link
Contributor

Converts test/lint/lint-shell.sh to Python and updates the docs accordingly. In order for the linter to run, it requires git and the shellcheck linter to be installed on the system. The script will fail gracefully with a help message if shellcheck is not installed.

@whiteh0rse
Copy link
Contributor Author

I noticed that terminal colors are being removed by the Python script. I did spend a little time trying to figure out how to pass along terminal colors, but wasn't successful. Let me know if I need to spend more time figuring that out.

As an example, here's what it looks like with the bash script:
Screenshot_2022-04-18_11-03-42

Here's what the same output looks like with the Python script:
Screenshot_2022-04-18_11-04-01

I tried using the encoding parameter (setting it to encoding='utf-8', but that didn't work.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

@whiteh0rse
Copy link
Contributor Author

whiteh0rse commented Apr 27, 2022

I think I need a little help squashing my commits in this pull request. Because in commit e38fc1c816a1e83b943cad2ffc953be5b2cd1fb6 I merged in from master, I'm now getting some merge conflicts while I squash.

Here's what I'm doing:

  • From HEAD, my first commit is 59 commits ago: git rev-list 24ac00b042a3f0343be95d283d90eb5d6579b629..HEAD | wc -l
  • I do git rebase -i HEAD~59 and change all the picks (except the first one) to squash.
  • Then I :wq (vim) and git begins rebasing.

About halfway thru I get a bunch of merge conflicts. Any help is appreciated. Thanks.

@maflcko
Copy link
Member

maflcko commented Apr 27, 2022

untested:

git checkout your_branch
git fetch origin bd616bc16a3a7f70f60ca5034b5a91e5ac89ac9d  # fetch current master
git merge        bd616bc16a3a7f70f60ca5034b5a91e5ac89ac9d  # merge current master
git reset --soft bd616bc16a3a7f70f60ca5034b5a91e5ac89ac9d  # pretend all changes happened on current master
git commit -m "your commit message"  # commit the changes
git push origin your_branch -f  # Force push

Maybe we should mention those steps as well in the doc?

@laanwj
Copy link
Member

laanwj commented Apr 27, 2022

Maybe we should mention those steps as well in the doc?

We could. Though only as a last-ditch option if you've ended up with a mess of merge commits. git rebase -i is way more flexible and something people need to be comfortable with to contribute to this project.

@whiteh0rse whiteh0rse force-pushed the 24783-port-lint-shell-to-python branch from d8afdaf to ccf67cf Compare April 30, 2022 20:49
@whiteh0rse
Copy link
Contributor Author

I believe I have finished squashing the commits. I will keep learning and practice git rebase. I do admit to be a bit of a novice at that git command. Thank you for the help.

@whiteh0rse whiteh0rse force-pushed the 24783-port-lint-shell-to-python branch 2 times, most recently from a6f34e1 to fcb895f Compare May 1, 2022 13:11
@whiteh0rse whiteh0rse force-pushed the 24783-port-lint-shell-to-python branch from fcb895f to 2b35abe Compare May 5, 2022 04:12
@whiteh0rse whiteh0rse force-pushed the 24783-port-lint-shell-to-python branch from 2b35abe to 7b29dbd Compare May 5, 2022 13:34
@whiteh0rse whiteh0rse force-pushed the 24783-port-lint-shell-to-python branch from 7b29dbd to bd6ceb4 Compare May 5, 2022 13:45
@maflcko maflcko merged commit c367736 into bitcoin:master May 5, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 5, 2022
@bitcoin bitcoin locked and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants