Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

hugovk
Copy link
Owner

@hugovk hugovk commented Jan 20, 2020

Add a tool to clone repos of popular projects, and run a test command for each. Stops when found a problem.

The default command is flake8 --select YTT1 to find potential Python 3.10 problems with https://github.com/asottile/flake8-2020.

Run on top 10 projects, will stop if the test command has a non-zero exit:

python3 repo_checker.py --number 10

Same, but if there's already an existing directory for a repo, it won't test that one again:

python3 repo_checker.py --number 10 --skip-existing

Using a custom command, CLONE_DIR will be replaced with the cloned directory. Here, will do a git pull in that repo to update:

python3 repo_checker.py --number 10 --command "git -C CLONE_DIR pull"

Custom command, will run for all repos, even if dirs exist, but will skip dirs "foo" and "bar".

python3 repo_checker.py --number 10 -c "flake8 --select XYZ CLONE_DIR" --repos foo bar

@hugovk hugovk added the enhancement New feature or request label Jan 20, 2020
@hugovk hugovk changed the title Add repo_checker.py Merge pull request #16 from hugovk/repo-checker Jan 20, 2020
@hugovk hugovk merged commit 8b3af4c into master Jan 20, 2020
@hugovk hugovk deleted the repo-checker branch January 20, 2020 13:13
@hugovk hugovk changed the title Merge pull request #16 from hugovk/repo-checker Add repo_checker.py Jan 20, 2020
Copy link

@rec rec left a comment

Choose a reason for hiding this comment

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

Thanks for doing this amazing work! Question out of idle curiosity - what are these two files used for? I can guess by reading them, but what tools read them?

@hugovk
Copy link
Owner Author

hugovk commented Jan 22, 2020

You're welcome!

repo_checker.py is something to run yourself from the command line, like the examples in #16 (comment).

I've been using it like:

$ python3 repo_checker.py -s -n 360
# it skips existing dirs, and clones and checks new projects, and fails when it finds something
# I check the problem, maybe create a PR
$ python3 repo_checker.py -s -n 360
# continues from where it left off

test_repo_checker.py is to help test repo_checker.py works properly when developing it.

@rec
Copy link

rec commented Jan 22, 2020

Ah, sorry, I meant the .yml and .toml files! :-)

@hugovk
Copy link
Owner Author

hugovk commented Jan 22, 2020

:)

.pre-commit-config.yaml is config for https://pre-commit.com. You can either install it locally (pip install pre-commit globally, then pre-commit install in the repo) and it'll do some lint testing of the modified files when you commit them.

It's also used to run the lint tests on the CI:

- pre-commit run --all-files


pyproject.toml is a config file for various tools, here for Black and isort linters.

It's becoming a new standard place for configuring things, see:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants