HOTFIX: SMASHED BUGS DURING MERGE

This commit is contained in:
Anmol
2020-07-31 20:21:01 +05:30
parent 478835b8d8
commit e16857d6ad
3 changed files with 40 additions and 18 deletions

View File

@@ -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,

View File

@@ -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:

23
main.py
View File

@@ -17,7 +17,6 @@ START_COMMENT = '<!--START_SECTION:waka-->'
END_COMMENT = '<!--END_SECTION:waka-->'
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