From 373c4f1ea76eb6b8409b7859e3c1c6f7a7cd5d28 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 3 Aug 2023 10:25:47 -0500 Subject: [PATCH] Update all_api_keys.json (#5277) * Update all_api_keys.json * Update CONTRIBUTING.md * Create json-yaml-validate * Update release-drafter.yml * Update json-yaml-validate * fix test * add json lint to general * Update tsconfig.json * Add a json_validate exclude to not check tests and certain known violations * fix workflow * not sure why this didnt exclude? --------- Co-authored-by: James Maslek --- .github/release-drafter.yml | 5 ----- .github/workflows/linting.yml | 12 ++++++++++++ CONTRIBUTING.md | 2 +- json_validate_exclude.txt | 3 +++ .../miscellaneous/models/all_api_keys.json | 4 ++-- .../test_OptionsChains_8.json | 2 +- website/tsconfig.json | 1 - 7 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 json_validate_exclude.txt diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 1d002032d50..0a776008049 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -3,21 +3,16 @@ tag-template: 'v$NEXT_MINOR_VERSION' exclude-contributors: - 'jmaslek' - 'DidierRLopes' - - 'JerBouma' - 'deeleeramone' - 'hjoaquim' - 'jose-donato' - 'luqmanbello' - - 'martinb-bb' - 'montezdesousa' - 'tehcoderer' - - 'Chavithra' - 'colin99d' - - 'northern-64bit' - 'piiq' - 'andrewkenreich' - 'IgorWounds' - - 'jerryduluk' - 'minhhoang1023' template: | diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 9aa4664b09c..4c1dae15afe 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -63,3 +63,15 @@ jobs: uses: docker://avtodev/markdown-lint:v1 with: args: "./*.md ./changelogs/*.md ./openbb_terminal/**/*.md ./discordbot/**/*.md" + + json-yaml-validate: + name: JSON Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: json-yaml-validate + id: json-yaml-validate + uses: GrantBirki/json-yaml-validate@v2.0.0 + with: + exclude_file: json_validate_exclude.txt \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06564d174ff..d2b90393c38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1213,7 +1213,7 @@ In order to do that, you'll simply need to choose from one the following files: 2. [hub_credentials.json](openbb_terminal/miscellaneous/models/hub_credentials.json) --> credentials that should be stored in the [OpenBB Hub](https://my.openbb.co/) like API keys to access your favorite providers. Then just update [all_api_keys.json](openbb_terminal/miscellaneous/models/all_api_keys.json) with the instructions to get -the api key from the data source website. +the api key from the data source website. Make sure that this file has the correct `.json` format, otherwise the API keys page in the Hub will break (e.g. in json the last element key-value pair shouldn't be followed by a comma, and the last object in a list of dictionaries should also not be followed by a comma). > Note: By differentiating between local and hub credentials, we can ensure that the user's credentials are not pushed to the [OpenBB Hub](https://my.openbb.co/) and are only stored locally. This does not mean that the credentials are not secure in the OpenBB Hub, but rather that the user can choose to store them locally if they wish. diff --git a/json_validate_exclude.txt b/json_validate_exclude.txt new file mode 100644 index 00000000000..da93f0e08ad --- /dev/null +++ b/json_validate_exclude.txt @@ -0,0 +1,3 @@ +tests/ +openbb_terminal/miscellaneous/gpt_index/index_0.4.json +.devcontainer/devcontainer.json \ No newline at end of file diff --git a/openbb_terminal/miscellaneous/models/all_api_keys.json b/openbb_terminal/miscellaneous/models/all_api_keys.json index 9356f255b5a..d9abe8d6dc9 100644 --- a/openbb_terminal/miscellaneous/models/all_api_keys.json +++ b/openbb_terminal/miscellaneous/models/all_api_keys.json @@ -273,6 +273,6 @@ "name": "API_BIZTOC_TOKEN", "source": "BizToc", "link": "https://biztoc.com", - "markdown": "The BizToc API is hosted on RapidAPI. To set up, go to: https://rapidapi.com/thma/api/biztoc.\n\n![biztoc0](https://github.com/marban/OpenBBTerminal/assets/18151143/04cdd423-f65e-4ad8-ad5a-4a59b0f5ddda)\n\nIn the top right, select 'Sign Up'. After answering some questions, you will be prompted to select one of their plans.\n\n![biztoc1](https://github.com/marban/OpenBBTerminal/assets/18151143/9f3b72ea-ded7-48c5-aa33-bec5c0de8422)\n\nAfter signing up, navigate back to https://rapidapi.com/thma/api/biztoc. If you are logged in, you will see a header called X-RapidAPI-Key.\n\n![biztoc2](https://github.com/marban/OpenBBTerminal/assets/18151143/0f3b6c91-07e0-447a-90cd-a9e23522929f)", - }, + "markdown": "The BizToc API is hosted on RapidAPI. To set up, go to: https://rapidapi.com/thma/api/biztoc.\n\n![biztoc0](https://github.com/marban/OpenBBTerminal/assets/18151143/04cdd423-f65e-4ad8-ad5a-4a59b0f5ddda)\n\nIn the top right, select 'Sign Up'. After answering some questions, you will be prompted to select one of their plans.\n\n![biztoc1](https://github.com/marban/OpenBBTerminal/assets/18151143/9f3b72ea-ded7-48c5-aa33-bec5c0de8422)\n\nAfter signing up, navigate back to https://rapidapi.com/thma/api/biztoc. If you are logged in, you will see a header called X-RapidAPI-Key.\n\n![biztoc2](https://github.com/marban/OpenBBTerminal/assets/18151143/0f3b6c91-07e0-447a-90cd-a9e23522929f)" + } ] diff --git a/tests/openbb_terminal/stocks/options/json/test_options_chains_model/test_OptionsChains_8.json b/tests/openbb_terminal/stocks/options/json/test_options_chains_model/test_OptionsChains_8.json index fdf60ae6e89..4f9d4a25da6 100644 --- a/tests/openbb_terminal/stocks/options/json/test_options_chains_model/test_OptionsChains_8.json +++ b/tests/openbb_terminal/stocks/options/json/test_options_chains_model/test_OptionsChains_8.json @@ -1 +1 @@ -["Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread", "Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread", "Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread", "Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread"] \ No newline at end of file +["Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread", "Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread", "Long Straddle", "Long Strangle", "Long Strangle", "Long Strangle", "Bull Call Spread", "Bear Put Spread"] \ No newline at end of file diff --git a/website/tsconfig.json b/website/tsconfig.json index 6f4756980d4..57bbce401d6 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -1,5 +1,4 @@ { - // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@tsconfig/docusaurus/tsconfig.json", "compilerOptions": { "baseUrl": "."