Easy way to check see is the longest contribution on GitHub for any public user (console and web mode)
For acomplish my goal I'm using the class HtmlParser
that I've created on my web-scraping-intro repo. You can check that old code too 😄
I'm open to suggestions, if you have any idea/comment/etc please let me know 😇
make prepare-local
I'm working a lot to make this code cleaner, so please go ahead and shot some issues if you want 😄
.
├── requirements.txt
├── src
│ ├── console.py
│ ├── infrastructure
│ ├── server.py
│ ├── templates
│ └── utils
└── tests
└── infrastructure
make start-console
You'll see something like this:
What's your GitHub account?
> jersson
Your longest contribution is...
- start date 2020-03-19
- end date 2020-04-03
- 16 days in a row!
make start-web
If everything is okay, you'll see this message:
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
So can go and test it
I'm using pytest
so you can launch that command
make test
You'll see something like this:
======================================= test session starts =======================================
platform darwin -- Python 3.11.6, pytest-8.0.0, pluggy-1.4.0
rootdir: /Users/jersson/src/dev/longest-github-contribution
collected 6 items
tests/infrastructure/test_github_client.py .. [ 33%]
tests/infrastructure/test_html_parser.py .... [100%]
======================================== 6 passed in 0.07s ========================================
- In some cases I'm using mocks, please be my guest to see the code 😄
- In case you want to test specific test cases, you can add the
@pytest.mark.only
annotation to work with the commandmake test-only
😉
Please be aware to work with Conventional Commits, and of course, be nice.
I'm working some bytes to explain how to automate minimal validations (commit-msg, pre-commit and so on) but if you have more ideas, please fill an issue 😄
TBD