From 920c57117df09b987ed5af4b5892e59ecdc84324 Mon Sep 17 00:00:00 2001 From: "pull[bot]" <39814207+pull[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:47:33 +0000 Subject: [PATCH] [pull] master from anuraghazra:master (#35) * docs(contributing guidelines): remove duplicate license section (#3333) * refactor: fix typo in TRY_AGAIN_LATER constant name (#3274) * docs: add available locales section (#3331) * docs: add available locales section * dev * docs: remove broken sponsor links (#3336) solves: #3334 Removed broken "Supported by" links in documentation * CI: Add static code analysis workflow (CodeQL) (#2918) * infra: enable no-with eslint rule (#3233) * infra: enable no-multiple-empty-lines eslint rule (#3262) * docs: fix relative README links (#3067) --------- Co-authored-by: Alexandr Garbuzov Co-authored-by: Vishal Sharma <106011641+vishal-sharma-369@users.noreply.github.com> Co-authored-by: Rick Staa --- .eslintrc.json | 4 +- .github/workflows/codeql-analysis.yml | 39 ++++++++++++++ CONTRIBUTING.md | 4 -- readme.md | 74 ++++++++++++++++++++++----- src/common/utils.js | 6 +-- 5 files changed, 105 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.eslintrc.json b/.eslintrc.json index d8c31c735a28d4..2edbe53fd95502 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -98,7 +98,7 @@ "terms": [ "TODO", "FIXME" ], "location": "start" }], - // "no-with": "warn", + "no-with": "warn", // "radix": "warn", // "vars-on-top": "error", @@ -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", diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000000000..da4545a80731f5 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9693c4b62a11be..8fdbf1fab9d66f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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). diff --git a/readme.md b/readme.md index f42f79e84d0b2f..e0cd50b5580541 100644 --- a/readme.md +++ b/readme.md @@ -24,12 +24,6 @@

- - - - - -

@@ -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 @@ -189,7 +183,7 @@ GitHub Readme Stats comes with several built-in themes (e.g. `dark`, `radical`, GitHub Readme Stats Themes -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 @@ -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) @@ -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]\ @@ -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: + + + +
+ +| Code | Locale | +| --- | --- | +| `cn` | Chinese | +| `zh-tw` | Chinese (Taiwan) | +| `ar` | Arabic | +| `cs` | Czech | +| `de` | German | +| `en` | English | +| `bn` | Bengali | +| `es` | Spanish | +| `fr` | French | +| `hu` | Hungarian | + + + +| 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 | + + + +| Code | Locale | +| --- | --- | +| `id` | Indonesian | +| `ml` | Malayalam | +| `my` | Burmese | +| `sk` | Slovak | +| `tr` | Turkish | +| `pl` | Polish | +| `uz` | Uzbek | +| `vi` | Vietnamese | +| `se` | Swedish | + +
+ +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)`. @@ -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) @@ -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 diff --git a/src/common/utils.js b/src/common/utils.js index 09063516d18fc4..1b38a9f28d3396 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -399,7 +399,7 @@ 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: @@ -407,8 +407,8 @@ const SECONDARY_ERROR_MESSAGES = { 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", };