Skip to content

An easy web way to check what was your longest contribution on GitHub

License

Notifications You must be signed in to change notification settings

jersson/longest-github-contribution

Repository files navigation

longest-github-contribution

CI Process

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 😇

Installation

Prerequisites

Dependencies

Local environment

  make prepare-local

Usage

Folder structure

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

How to run the code as a console program

  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!

How to run the web app

  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

How to run the automated tests

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 command make test-only 😉

How to contribute

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 😄

References

TBD