Skip to content

Commit

Permalink
[pull] master from anuraghazra:master (#35)
Browse files Browse the repository at this point in the history
* docs(contributing guidelines): remove duplicate license section (anuraghazra#3333)

* refactor: fix typo in TRY_AGAIN_LATER constant name (anuraghazra#3274)

* docs: add available locales section (anuraghazra#3331)

* docs: add available locales section

* dev

* docs: remove broken sponsor links (anuraghazra#3336)

solves: anuraghazra#3334

Removed broken "Supported by" links in documentation

* CI: Add static code analysis workflow (CodeQL) (anuraghazra#2918)

* infra: enable no-with eslint rule (anuraghazra#3233)

* infra: enable no-multiple-empty-lines eslint rule (anuraghazra#3262)

* docs: fix relative README links (anuraghazra#3067)

---------

Co-authored-by: Alexandr Garbuzov <qwerty541zxc@gmail.com>
Co-authored-by: Vishal Sharma <106011641+vishal-sharma-369@users.noreply.github.com>
Co-authored-by: Rick Staa <rick.staa@outlook.com>
  • Loading branch information
4 people authored Oct 13, 2023
1 parent dd68af3 commit 920c571
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"terms": [ "TODO", "FIXME" ],
"location": "start"
}],
// "no-with": "warn",
"no-with": "warn",
// "radix": "warn",
// "vars-on-top": "error",

Expand Down Expand Up @@ -194,7 +194,7 @@
// "no-inline-comments": "off",
// "no-lonely-if": "warn",
// "no-mixed-spaces-and-tabs": "warn",
// "no-multiple-empty-lines": "warn",
"no-multiple-empty-lines": "warn",
// "no-negated-condition": "off",
// "no-nested-ternary": "warn",
// "no-new-object": "warn",
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Static code analysis workflow (CodeQL)"

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
actions: read
checks: read
contents: read
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: write
statuses: read

jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@46a6823b81f2d7c67ddf123851eea88365bc8a67 # v2.13.5
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@46a6823b81f2d7c67ddf123851eea88365bc8a67 # v2.13.5
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,3 @@ People _love_ thorough bug reports. I'm not even kidding.
- A quick idea summary
- What & why do you want to add the specific feature
- Additional context like images, links to resources to implement the feature, etc.

## License

By contributing, you agree that your contributions will be licensed under its [MIT License](./LICENSE).
74 changes: 61 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
</a>
<br />
<br />
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
<img src="https://img.shields.io/badge/Supported%20by-VSCode%20Power%20User%20%E2%86%92-gray.svg?colorA=655BE1&colorB=4F44D6&style=for-the-badge"/>
</a>
<a href="https://a.paddle.com/v2/click/16413/119403?link=2345">
<img src="https://img.shields.io/badge/Supported%20by-Node%20Cli.com%20%E2%86%92-gray.svg?colorA=61c265&colorB=4CAF50&style=for-the-badge"/>
</a>
</p>

<p align="center">
Expand Down Expand Up @@ -143,7 +137,7 @@ Change the `?username=` value to your GitHub username.
> By default, the stats card only shows statistics like stars, commits and pull requests from public repositories. To show private statistics on the stats card, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token.
> [!NOTE]\
> Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on the [Japanese academic grading](https://wikipedia.org/wiki/Academic_grading_in_Japan) system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, reviews, issues, stars and followers), based on the cumulative distribution function of the [exponential](https://wikipedia.org/wiki/exponential_distribution) and the [log-normal](https://wikipedia.org/wiki/Log-normal_distribution) distributions. The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js). The circle around the rank shows 100 minus the global percentile.
> Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on the [Japanese academic grading](https://wikipedia.org/wiki/Academic_grading_in_Japan) system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, reviews, issues, stars and followers), based on the cumulative distribution function of the [exponential](https://wikipedia.org/wiki/exponential_distribution) and the [log-normal](https://wikipedia.org/wiki/Log-normal_distribution) distributions. The implementation can be investigated at [src/calculateRank.js](src/calculateRank.js). The circle around the rank shows 100 minus the global percentile.
### Hiding individual stats

Expand Down Expand Up @@ -189,7 +183,7 @@ GitHub Readme Stats comes with several built-in themes (e.g. `dark`, `radical`,

<img src="https://res.cloudinary.com/anuraghazra/image/upload/v1595174536/grs-themes_l4ynja.png" alt="GitHub Readme Stats Themes" width="600px"/>

You can look at a preview for [all available themes](./themes/README.md) or checkout the [theme config file](./themes/index.js). You can also contribute new themes if you like, contributing guidelines can be found [here](./CONTRIBUTING.md#themes-contribution).
You can look at a preview for [all available themes](themes/README.md) or checkout the [theme config file](themes/index.js). You can also contribute new themes if you like, contributing guidelines can be found [here](CONTRIBUTING.md#themes-contribution).

#### Responsive Card Theme

Expand All @@ -215,7 +209,7 @@ We have included a `transparent` theme that has a transparent background. This t

##### Add transparent alpha channel to a themes bg\_color

You can use the `bg_color` parameter to make any of [the available themes](./themes/README.md) transparent. This is done by setting the `bg_color` to a color with a transparent alpha channel (i.e. `bg_color=00000000`):
You can use the `bg_color` parameter to make any of [the available themes](themes/README.md) transparent. This is done by setting the `bg_color` to a color with a transparent alpha channel (i.e. `bg_color=00000000`):

```md
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&bg_color=00000000)
Expand Down Expand Up @@ -292,9 +286,9 @@ You can customize the appearance of all your cards however you wish with URL par
* `border_color` - Card's border color *(hex color)*. Default: `e4e2e2` (Does not apply when `hide_border` is enabled).
* `bg_color` - Card's background color *(hex color)* **or** a gradient in the form of *angle,start,end*. Default: `fffefe`
* `hide_border` - Hides the card's border *(boolean)*. Default: `false`
* `theme` - Name of the theme, choose from [all available themes](./themes/README.md). Default: `default` theme.
* `theme` - Name of the theme, choose from [all available themes](themes/README.md). Default: `default` theme.
* `cache_seconds` - Sets the cache header manually *(min: 21600, max: 86400)*. Default: `21600 seconds (6 hours)`.
* `locale` - Sets the language in the card *(e.g. cn, de, es, etc.)*. Default: `en`.
* `locale` - Sets the language in the card, you can check full list of available locales [here](#available-locales). Default: `en`.
* `border_radius` - Corner rounding on the card. Default: `4.5`.

> [!WARNING]\
Expand All @@ -306,6 +300,60 @@ You can provide multiple comma-separated values in the bg\_color option to rende

&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10

##### Available locales

Here is a list of all available locales:

<table>
<tr><td>

| Code | Locale |
| --- | --- |
| `cn` | Chinese |
| `zh-tw` | Chinese (Taiwan) |
| `ar` | Arabic |
| `cs` | Czech |
| `de` | German |
| `en` | English |
| `bn` | Bengali |
| `es` | Spanish |
| `fr` | French |
| `hu` | Hungarian |

</td><td>

| Code | Locale |
| --- | --- |
| `it` | Italian |
| `ja` | Japanese |
| `kr` | Korean |
| `nl` | Dutch |
| `pt-pt` | Portuguese (Portugal) |
| `pt-br` | Portuguese (Brazil) |
| `np` | Nepali |
| `el` | Greek |
| `ru` | Russian |
| `uk-ua` | Ukrainian |

</td><td>

| Code | Locale |
| --- | --- |
| `id` | Indonesian |
| `ml` | Malayalam |
| `my` | Burmese |
| `sk` | Slovak |
| `tr` | Turkish |
| `pl` | Polish |
| `uz` | Uzbek |
| `vi` | Vietnamese |
| `se` | Swedish |

</td></tr>
</table>

If we don't support your language, please consider contributing!

#### Stats Card Exclusive Options

* `hide` - Hides the [specified items](#hiding-individual-stats) from stats *(Comma-separated values)*. Default: `[] (blank array)`.
Expand Down Expand Up @@ -697,7 +745,7 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
> Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58), we should be able to handle more than 5k requests and have fewer issues with downtime :grin:.
> [!NOTE]\
> If you are on the [Pro (i.e. paid)](https://vercel.com/pricing) Vercel plan, the [maxDuration](https://vercel.com/docs/concepts/projects/project-configuration#value-definition) value found in the [Vercel.json](https://github.com/anuraghazra/github-readme-stats/blob/master/vercel.json) can be increased when your Vercel instance frequently times out during the card request. You are advised to keep this value lower than `30` seconds to prevent high memory usage.
> If you are on the [Pro (i.e. paid)](https://vercel.com/pricing) Vercel plan, the [maxDuration](https://vercel.com/docs/concepts/projects/project-configuration#value-definition) value found in the [Vercel.json](vercel.json) can be increased when your Vercel instance frequently times out during the card request. You are advised to keep this value lower than `30` seconds to prevent high memory usage.
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)

Expand Down Expand Up @@ -767,7 +815,7 @@ Thanks! :heart:

***

[![https://vercel.com?utm\_source=github\_readme\_stats\_team\&utm\_campaign=oss](./powered-by-vercel.svg)](https://vercel.com?utm_source=github_readme_stats_team\&utm_campaign=oss)
[![https://vercel.com?utm\_source=github\_readme\_stats\_team\&utm\_campaign=oss](powered-by-vercel.svg)](https://vercel.com?utm_source=github_readme_stats_team\&utm_campaign=oss)

Contributions are welcome! <3

Expand Down
6 changes: 3 additions & 3 deletions src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,16 @@ const CONSTANTS = {
ERROR_CACHE_SECONDS: TEN_MINUTES,
};

const TRY_AGAING_LATER = "Please try again later";
const TRY_AGAIN_LATER = "Please try again later";

const SECONDARY_ERROR_MESSAGES = {
MAX_RETRY:
"You can deploy own instance or wait until public will be no longer limited",
NO_TOKENS:
"Please add an env variable called PAT_1 with your GitHub API token in vercel",
USER_NOT_FOUND: "Make sure the provided username is not an organization",
GRAPHQL_ERROR: TRY_AGAING_LATER,
GITHUB_REST_API_ERROR: TRY_AGAING_LATER,
GRAPHQL_ERROR: TRY_AGAIN_LATER,
GITHUB_REST_API_ERROR: TRY_AGAIN_LATER,
WAKATIME_USER_NOT_FOUND: "Make sure you have a public WakaTime profile",
};

Expand Down

1 comment on commit 920c571

@vercel
Copy link

@vercel vercel bot commented on 920c571 Oct 13, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.