From e16857d6ad2309d8a49426083b44094c2bfcee59 Mon Sep 17 00:00:00 2001 From: Anmol Date: Fri, 31 Jul 2020 20:21:01 +0530 Subject: [PATCH] HOTFIX: SMASHED BUGS DURING MERGE --- README.md | 23 ++++++++++++++++++++++- action.yml | 12 ++++++------ main.py | 23 ++++++++++++----------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d03ec33..b1b3877 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ jobs: #### Flags Available `SHOW_LINES_OF_CODE` flag can be set to `True` to show the Lines of code writen till date -![Lines of code](https://img.shields.io/badge/From%20Hello%20World%20I've%20written-12,66,814%20Lines%20of%20code-blue) +![Lines of code](https://img.shields.io/badge/From%20Hello%20World%20I've%20written-1.28M%20Lines%20of%20code-blue) `SHOW_COMMIT` flag can be set to `False` to hide the commit stats @@ -183,6 +183,27 @@ PhpStorm 1 hr 35 mins ████░░░░░░░ PyCharm 23 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 4.49% ``` +`SHOW_LANGUAGE_PER_REPO` flag can be set to `False` to hide the Number of repository in different language and frameworks + +**I mostly code in Vue** + +```text +Vue 8 repos ██████░░░░░░░░░░░░░░░░░░░ 25.0% +Java 6 repos ████░░░░░░░░░░░░░░░░░░░░░ 18.75% +JavaScript 6 repos ████░░░░░░░░░░░░░░░░░░░░░ 18.75% +PHP 3 repos ██░░░░░░░░░░░░░░░░░░░░░░░ 9.38% +Python 2 repos █░░░░░░░░░░░░░░░░░░░░░░░░ 6.25% +Dart 2 repos █░░░░░░░░░░░░░░░░░░░░░░░░ 6.25% +CSS 2 repos █░░░░░░░░░░░░░░░░░░░░░░░░ 6.25% + +``` + +`SHOW_LOC_CHART` flag can be set to `False` to hide the Lines of code written in different quarters of different year + +**Timeline** + +![Chart not found](https://raw.githubusercontent.com/anmol098/anmol098/master/charts/bar_graph.png) + ## :sparkling_heart: Support the project I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, diff --git a/action.yml b/action.yml index 0a91b88..32292c7 100644 --- a/action.yml +++ b/action.yml @@ -12,11 +12,6 @@ inputs: description: 'Your Wakatime API Key' required: true - USERNAME: - description: 'Your GitHub username' - required: false - default: ${{ github.repository_owner }} - SHOW_OS: required: false description: 'Show the list of OS Worked on In dev metrics' @@ -54,7 +49,7 @@ inputs: SHOW_LANGUAGE_PER_REPO: required: false - description: "" + description: "Show language or framework used across different repository" default: "True" SHOW_LOC_CHART: @@ -62,6 +57,11 @@ inputs: description: "" default: "True" + SHOW_DAYS_OF_WEEK: + required: false + description: "show day of week you are most productive" + default: "True" + runs: diff --git a/main.py b/main.py index d2f8b9d..e4d2243 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,6 @@ START_COMMENT = '' END_COMMENT = '' listReg = f"{START_COMMENT}[\\s\\S]+{END_COMMENT}" -user = os.getenv('INPUT_USERNAME') waka_key = os.getenv('INPUT_WAKATIME_API_KEY') ghtoken = os.getenv('INPUT_GH_TOKEN') showTimeZone = os.getenv('INPUT_SHOW_TIMEZONE') @@ -27,7 +26,7 @@ showOs = os.getenv('INPUT_SHOW_OS') showCommit = os.getenv('INPUT_SHOW_COMMIT') showLanguage = os.getenv('INPUT_SHOW_LANGUAGE') show_loc = os.getenv('INPUT_SHOW_LINES_OF_CODE') - +show_days_of_week = os.getenv('INPUT_SHOW_DAYS_OF_WEEK') showLanguagePerRepo = os.getenv('INPUT_SHOW_LANGUAGE_PER_REPO') showLocChart = os.getenv('INPUT_SHOW_LOC_CHART') show_waka_stats = 'y' @@ -271,19 +270,21 @@ def generate_commit_list(tz): {"name": "Sunday", "text": str(Sunday) + " commits", "percent": round((Sunday / sum_week) * 100, 2)}, ] - max_element = { - 'percent': 0 - } - - for day in dayOfWeek: - if day['percent'] > max_element['percent']: - max_element = day - days_title = 'I\'m Most Productive on ' + max_element['name'] + 's' if show_loc.lower() in ['true', '1', 't', 'y', 'yes']: string = string + '![Lines of code](https://img.shields.io/badge/From%20Hello%20World%20I\'ve%20written-' + human_format( int(total_loc)) + '%20Lines%20of%20code-blue)\n\n' string = string + '**' + title + '** \n\n' + '```text\n' + make_commit_list(one_day) + '\n\n```\n' - string = string + '📅 **' + days_title + '** \n\n' + '```text\n' + make_commit_list(dayOfWeek) + '\n\n```\n' + + if show_days_of_week.lower() in ['true', '1', 't', 'y', 'yes']: + max_element = { + 'percent': 0 + } + + for day in dayOfWeek: + if day['percent'] > max_element['percent']: + max_element = day + days_title = 'I\'m Most Productive on ' + max_element['name'] + 's' + string = string + '📅 **' + days_title + '** \n\n' + '```text\n' + make_commit_list(dayOfWeek) + '\n\n```\n' return string