bash-it icon indicating copy to clipboard operation
bash-it copied to clipboard

Help us clean up Bash-it!

Open NoahGorny opened this issue 4 years ago • 13 comments

Hello folks! We have now integrated pre-commit hooks in order to improve the codebase quality. and now we need to start going through the files. We invite anyone who wants to contribute to this effort to try this out:

  • Choose a file in the project, which is not present in clean_files.txt
  • Add the path from the root of the project to the file in clean_files.txt
  • Run ./lint_clean_files.sh, and fix the issues
  • When pre-commit runs successfully, feel free to open a PR
  • Hooray, you helped us make Bash-it better! :smile:

An example PR, would be #1695

NoahGorny avatar Oct 31 '20 11:10 NoahGorny

Pre commit can be ignore using --no-verify and it will also frustrate the contributor when they are working on too many commits. So I would recommend you to add these checking tasks in the github workflow

tbhaxor avatar Dec 20 '20 10:12 tbhaxor

I will help you refactoring bash-it

tbhaxor avatar Dec 20 '20 10:12 tbhaxor

Pre commit can be ignore using --no-verify and it will also frustrate the contributor when they are working on too many commits. So I would recommend you to add these checking tasks in the github workflow

It is indeed pretty frustrating, but checked in the CI (see lint stage)

Also see #1746 for better instructions

Thanks you @tbhaxor for helping us :heart:

NoahGorny avatar Dec 20 '20 11:12 NoahGorny

Hey @NoahGorny I found so much inconsistent code in plugins directory. :smile:

tbhaxor avatar Dec 27 '20 17:12 tbhaxor

Hey @NoahGorny I found so much inconsistent code in plugins directory. smile

Hi @tbhaxor, there is indeed a lot of inconsistent code in the plugins (and in the rest of the codebase as well). It does not mean we should give up though! We can continue improving the codebase, one PR at a time :smile:

NoahGorny avatar Dec 28 '20 20:12 NoahGorny

@tbhaxor haha indeed. Luckily, @NoahGorny has been putting in an amazing amount of effort into figuring out our contribution guidelines and tooling. I see a bright future ahead, especially with great contributors like you helping us clean everything up!! :)

cornfeedhobo avatar Jan 01 '21 22:01 cornfeedhobo

@NoahGorny Is anything left in this?

tbhaxor avatar Apr 13 '21 08:04 tbhaxor

@NoahGorny Is anything left in this?

There are actually many things that are still not cleaned up- most of the plugins, the lib directory, and also the install script. If you want on those things, it would be really great :smile:

NoahGorny avatar Apr 14 '21 11:04 NoahGorny

@tbhaxor hi, I was wondering if you have already started on this? I'd also like to lend a hand if you're not already done

cevhyruz avatar Apr 19 '21 02:04 cevhyruz

@NoahGorny Is anything left in this?

There are actually many things that are still not cleaned up- most of the plugins, the lib directory, and also the install script. If you want on those things, it would be really great

@NoahGorny @cevhyruz Actually I am down with covid so I won't be able to work on that. Could you guys take care of it?

tbhaxor avatar Apr 19 '21 15:04 tbhaxor

Sorry to hear that, hope you get well soon.

I'll be starting to work on it then.

@NoahGorny, @tbhaxor Just a quick question, should I need a separate PR for every file / directory that has been cleaned or should I just commit everything in a single PR?

cevhyruz avatar Apr 19 '21 16:04 cevhyruz

Well @tbhaxor, I hope you will get through this, you have my support!

Sorry to hear that, hope you get well soon.

I'll be starting to work on it then.

@NoahGorny, @tbhaxor Just a quick question, should I need a separate PR for every file / directory that has been cleaned or should I just commit everything in a single PR?

I prefer that you split your work into separate PRs, this way is easier to check and merge. If you have any troubles feel free to contact me.

Thanks for your decision to help Bash-it! You rock :smile:

NoahGorny avatar Apr 19 '21 16:04 NoahGorny

seems like I can't compile the pre-commit hooks without a bit of help (see bottom)

        as: unrecognized option '--gdwarf-5'
        error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /home/ira/.cache/pre-commit/repop169ejxs/py_env-python3.9/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-707uv1_t/python-levenshtein_1a27053a5a29481fbbdcee325f499a89/setup.py'"'"'; __file__='"'"'/tmp/pip-install-707uv1_t/python-levenshtein_1a27053a5a29481fbbdcee325f499a89/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-oab8hg3w/install-record.txt --single-version-externally-managed --compile --install-headers /home/ira/.cache/pre-commit/repop169ejxs/py_env-python3.9/include/site/python3.9/python-Levenshtein Check the logs for full command output.
    
Check the log at /home/ira/.cache/pre-commit/pre-commit.log

version information

pre-commit version: 2.17.0
git --version: git version 2.32.0
sys.version:
    3.9.7 (default, Sep 10 2021, 14:59:43) 
    [GCC 11.2.0]
sys.executable: /usr/bin/python
os.name: posix
sys.platform: linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10

setting export CC=gcc-8 does the trick (a search says any version gcc-10 and earlier would do)

seefood avatar Feb 11 '22 08:02 seefood