From 59f5fe41a92f56088c5d6d982797b224d5a065c4 Mon Sep 17 00:00:00 2001 From: Abhishek Bhagwat Date: Wed, 18 Dec 2024 17:22:36 -0800 Subject: [PATCH] add initial precommit workflows (#150) * add initial precommit workflows * make linter executable * update PR template, add spellcheck * fix linter errors * fix more linter errors --- .github/.OwlBot.lock.yaml | 17 + .github/.OwlBot.yaml | 16 + .github/PULL_REQUEST_TEMPLATE.md | 21 + .github/linters/.flake8 | 2 + .github/linters/.gitleaks.toml | 15 + .github/linters/.htmlhintrc | 4 + .github/linters/.markdown-lint.yml | 2 + .github/linters/.mypy.ini | 18 + .github/linters/.python-lint | 2 + .github/linters/.sqlfluff | 12 + .github/linters/.textlintrc | 10 + .github/spelling/README.md | 18 + .github/spelling/advice.md | 28 + .github/spelling/allow.txt | 1138 +++++++++++++++++ .github/spelling/block-delimiters.list | 15 + .github/spelling/candidate.patterns | 675 ++++++++++ .github/spelling/excludes.txt | 116 ++ .github/spelling/expect.txt | 0 .github/spelling/line_forbidden.patterns | 311 +++++ .github/spelling/patterns.txt | 253 ++++ .github/spelling/reject.txt | 11 + .github/workflows/links.yaml | 25 + .github/workflows/linter.yaml | 68 + .github/workflows/notebook-lint.yaml | 32 + .../notebook_linter/requirements.txt | 12 + .../workflows/notebook_linter/run_linter.sh | 191 +++ .github/workflows/spelling.yaml | 158 +++ .github/workflows/update_notebook_links.py | 110 ++ 28 files changed, 3280 insertions(+) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/linters/.flake8 create mode 100644 .github/linters/.gitleaks.toml create mode 100644 .github/linters/.htmlhintrc create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/linters/.mypy.ini create mode 100644 .github/linters/.python-lint create mode 100644 .github/linters/.sqlfluff create mode 100644 .github/linters/.textlintrc create mode 100644 .github/spelling/README.md create mode 100644 .github/spelling/advice.md create mode 100644 .github/spelling/allow.txt create mode 100644 .github/spelling/block-delimiters.list create mode 100644 .github/spelling/candidate.patterns create mode 100644 .github/spelling/excludes.txt create mode 100644 .github/spelling/expect.txt create mode 100644 .github/spelling/line_forbidden.patterns create mode 100644 .github/spelling/patterns.txt create mode 100644 .github/spelling/reject.txt create mode 100644 .github/workflows/links.yaml create mode 100644 .github/workflows/linter.yaml create mode 100644 .github/workflows/notebook-lint.yaml create mode 100644 .github/workflows/notebook_linter/requirements.txt create mode 100644 .github/workflows/notebook_linter/run_linter.sh create mode 100644 .github/workflows/spelling.yaml create mode 100644 .github/workflows/update_notebook_links.py diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..4a82ab79 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest + digest: sha256:d0e70b7cbce0f340c4755bafee5c1ef754c4e83927ecce8988f4f4c530572f61 diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..fb543f39 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,16 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..43fae871 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +# Pull-Request Template + +Thank you for your contribution! Please provide a brief description of your changes and ensure you've completed the checklist below. + +## Description + +What does this PR do? Why is it necessary? + +**Fixes #** (if applicable) + +## Checklist + +- [ ] **Contribution Guidelines:** I have read the [Contribution Guidelines](../CONTRIBUTING). +- [ ] **CLA:** I have signed the [CLA](https://cla.developers.google.com). +- [ ] **Authorship:** I am listed as the author (if applicable). +- [ ] **Conventional Commits:** My PR title and commit messages follow the [Conventional Commits](https://www.conventialcommits.org) spec. +- [ ] **Code Format:** I have run `nox -s format` to format the code. +- [ ] **Spelling:** I have fixed any spelling errors, and added false positives to .github/actions/spelling/allow.txt if necessary. +- [ ] **Template:** I have followed the `aaie_notebook_template.ipynb` if submitting a new jupyter notbook. +- [ ] **Sync:** My Fork is synced with the upstream. +- [ ] **Documentations:** I have updated relevant documentations (if applicable) in the [docs folder](../docs). diff --git a/.github/linters/.flake8 b/.github/linters/.flake8 new file mode 100644 index 00000000..a6578a30 --- /dev/null +++ b/.github/linters/.flake8 @@ -0,0 +1,2 @@ +[flake8] +extend-ignore = E501 diff --git a/.github/linters/.gitleaks.toml b/.github/linters/.gitleaks.toml new file mode 100644 index 00000000..614aaeb0 --- /dev/null +++ b/.github/linters/.gitleaks.toml @@ -0,0 +1,15 @@ +title = "gitleaks config" + +[extend] +# useDefault will extend the base configuration with the default gitleaks config: +# https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml +useDefault = true + +[[rules]] + id = "aws-access-token" + description = "AWS Access Token" + regex = '''AKIA[0-9A-Z]{16}''' + [rules.allowlist] + paths = [ + "gemini/use-cases/education/ai_quick_build_experience_backend.ipynb" + ] diff --git a/.github/linters/.htmlhintrc b/.github/linters/.htmlhintrc new file mode 100644 index 00000000..9524ad08 --- /dev/null +++ b/.github/linters/.htmlhintrc @@ -0,0 +1,4 @@ +{ + "id-class-value": false, + "attr-lowercase": false +} diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 00000000..1fdde2ff --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,2 @@ +no-inline-html: false +line-length: false diff --git a/.github/linters/.mypy.ini b/.github/linters/.mypy.ini new file mode 100644 index 00000000..2b8224ba --- /dev/null +++ b/.github/linters/.mypy.ini @@ -0,0 +1,18 @@ +[mypy] + +disallow_untyped_calls = True +disallow_untyped_defs = True +disallow_incomplete_defs = True +no_implicit_optional = True +check_untyped_defs = True +disallow_subclassing_any = True +warn_incomplete_stub = True +warn_redundant_casts = True +warn_unused_ignores = True +warn_unreachable = True + +follow_imports = skip +ignore_missing_imports = True + +explicit_package_bases = True +disable_error_code = misc, no-untyped-call, no-any-return diff --git a/.github/linters/.python-lint b/.github/linters/.python-lint new file mode 100644 index 00000000..b6d9e03f --- /dev/null +++ b/.github/linters/.python-lint @@ -0,0 +1,2 @@ +[MESSAGES CONTROL] +disable=E0401,C0301,R0903,R1710,C0114,R0915,W1514,W1203,I1101 diff --git a/.github/linters/.sqlfluff b/.github/linters/.sqlfluff new file mode 100644 index 00000000..a66ea3d2 --- /dev/null +++ b/.github/linters/.sqlfluff @@ -0,0 +1,12 @@ +[sqlfluff] + +dialect = bigquery +templater = placeholder + +exclude_rules = CV06, RF05 + +[sqlfluff:templater:placeholder] +param_style = question_mark + +[sqlfluff:indentation] +tab_space_size = 2 diff --git a/.github/linters/.textlintrc b/.github/linters/.textlintrc new file mode 100644 index 00000000..50bc05a4 --- /dev/null +++ b/.github/linters/.textlintrc @@ -0,0 +1,10 @@ +{ + "rules": { + "terminology": { + "defaultTerms": true, + "exclude": [ + "README" + ] + } + } +} diff --git a/.github/spelling/README.md b/.github/spelling/README.md new file mode 100644 index 00000000..94c8a133 --- /dev/null +++ b/.github/spelling/README.md @@ -0,0 +1,18 @@ +# check-spelling/check-spelling configuration + +| File | Purpose | Format | Info | +| -------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| [dictionary.txt](dictionary.txt) | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary) | +| [allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow) | +| [reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject) | +| [excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes) | +| [only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only) | +| [patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) | +| [candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-patterns) | +| [line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) | +| [expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect) | +| [advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice) | +| [block-delimiters.list](block-delimiters.list) | Define block begin/end markers to ignore lines of text | line with _literal string_ for **start** followed by line with _literal string_ for **end** | [block ignore](https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Block-Ignore#status) | + +Note: you can replace any of these files with a directory by the same name (minus the suffix) +and then include multiple files inside that directory (with that suffix) to merge multiple files together. diff --git a/.github/spelling/advice.md b/.github/spelling/advice.md new file mode 100644 index 00000000..2c0631a0 --- /dev/null +++ b/.github/spelling/advice.md @@ -0,0 +1,28 @@ + +
If the flagged items are :exploding_head: false positives + +If items relate to a ... + +- binary file (or some other file you wouldn't want to check at all). + + Please add a file path to the `excludes.txt` file matching the containing file. + + File paths are Perl 5 Regular Expressions - you can [test](https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. + + `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude `README.md` (on whichever branch you're using). + +- well-formed pattern. + + If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it, + try adding it to the `patterns.txt` file. + + Patterns are Perl 5 Regular Expressions - you can [test](https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + + Note that patterns can't match multiline strings. + +
+ + + +:steam_locomotive: If you're seeing this message and your PR is from a branch that doesn't have check-spelling, +please merge to your PR's base branch to get the version configured for your repository. diff --git a/.github/spelling/allow.txt b/.github/spelling/allow.txt new file mode 100644 index 00000000..400b4ba2 --- /dev/null +++ b/.github/spelling/allow.txt @@ -0,0 +1,1138 @@ +AALR +ADMA +AFX +AGG +AIP +AMNOSH +ANZ +APAC +APIENTRY +APSTUDIO +ASF +ASML +AUVs +Adidas +Akihiro +Akkaoui +Aktu +Aniston +Arborio +Arepa +Arjen +Arsan +Artsakh +Ashish +Aspeed +Atticus +Autechre +Autorater +BIKBEAR +BITCODE +BYOR +Baggins +Bao +Beckham +Benno +Bettes +Biden +Bigtable +Bitcoin +Borregas +Borthwick +Borussia +Bottas +Boyz +Breazeal +Broadoak +Btn +Buckleys +Buffay +CALIPSO +CHECKOV +CLA +CLASSPATH +CLIs +COCOAPODS +COINIT +CONOUT +COUNTIF +CRM +CUAD +CUCUONAR +CVD +CWLEY +CZE +Caitlyn +Caprese +Carreras +Chocolat +Codelab +Codey +Codicote +Colab +Colm +Cowabunga +Crossbody +D'orsay +DHH +DLC +DLCs +DOCDB +DPO +DRV +DVDs +DWMWA +Daniil +Dataform +DeepEval +Depatmint +Dexin +Disturbia +Doaa +Doogler +Dreesen +Duh +Durafast +Durmus +Dzor +EDB +EHR +EHsc +EIC +EIP +EMEA +EMFU +EMNLP +ENU +ESG +Edunov +Eleuther +Eliud +Embs +Envane +Eragon +Esin +Eventarc +FAISS +FIA +FILEFLAGS +FILEOS +FLX +FMWK +FPDF +FTPS +Fangming +Federer +Feitian +Feng +Finvest +Firestore +Fishburne +Flahs +Flatform +Flipkart +Folmer +Frodo +Fujita +GError +GFile +GKE +GObject +GWLP +Gabeira +Gameplay +Gandalf +Gatace +GenTwo +Gfm +Gisting +Glickman +Gmb +GmbH +Godzilla +Googlers +Guardiola +Gundogan +HBox +HDFC +HDFS +HIDPI +HIGHCPU +HMO +HREDRAW +HSA +HVDC +HZN +Hadoop +Hamamoto +Hamblin +Hamers +Harvick +Hawkins'll +Hbf +Hickson +Hida +Hikaru +Hisaki +Hmmm +Hogwarts +Hossain +Hubmann +Hyperdisk +ICICI +ICML +IFI +INFOPLIST +IOMGR +IRAs +ITDMs +IVF +Ilkay +Iosif +Isner +J'aime +JAVACMD +JDK +JHome +JPY +Jang +Jax +Jedi +Jian +Jibo +Joji +Jolyon +Junzhe +KFBI +KNN +KPIs +KSA +Kaelen +Kaggle +Kalamang +Kamradt +Kanagawa +Katelyn +Kaufmanns +Kawagoe +Keanu +Keown +Ketamine +Khanh +Kimi +Kipchoge +Knopf +Kohli +Kraizt +Kubeflow +Kudrow +Kvyat +Kylian +LCEL +LLMs +LMPA +LOOKBACK +LRESULT +LSTATUS +LSTM +LSum +LTRB +LUVBPTK +Ladhak +LangGraph +Lego +Leung +Llion +Loghub +Logrus +Lopyrev +Lottry +MFU +MICOA +MLB +MMA +MSCHF +MSGSEND +MTL +Maa +Maarten +Mahindra +Malware +Mamah +Mandiri +Masaru +Mbappe +Meawad +Mega +Memegen +Meteo +Mewgler +Milito +Mirai +Mitani +Molaison +Mosher +Mvar +NADPH +NARI +NCCREATE +NDCG +NDEBUG +NGRAM +NGRAMS +NHK +NICOLAS +NMT +NOMINMAX +NOZORDER +NVIDIA +NVL +Nagasu +Nakoso +Narnia +Niitsuma +Nintendo +Nith +Nominatim +Noogler +ODb +OLAP +OOTB +Oberst +Ohashi +Ohtani +Olgivanna +Ollama +Omnibox +Onone +Oort +Orbelians +PBA +PDEs +PDFs +PEFT +PGHOST +PGPORT +PGUSER +PLOTLYENV +PPO +PYINK +Pakeman +Paquete +Parmar +Pengyu +Persero +Phaidon +Phanfone +Pharma +Photoshop +Pistorius +Pranav +Priyanka +QLo +QPM +Qwiklab +Qwiklabs +RAGAS +REPOURL +RLHF +RMSE +RNN +RNNs +ROOTSPAN +RRF +RTN +RUNPATH +RYDE +Raducanu +Raikkonen +Rajpurkar +Reranking +Resona +Ricciardo +Rizzoli +Robben +Robeco +Robo +Ronaldo +Rosberg +Rosso +Rousey +Ruchika +SAOT +SDKROOT +SEK +SEO +SIMONE +SKUs +SMSN +SNB +SNE +SPII +SPLADE +SRE +SSRF +STIX +SUBLANG +SWP +SYMED +SYSROOT +Sagar +Sahel +Sauron +Sca +Schlenoff +Schwimmer +Selam +Sestero +Shazeer +Shenzhou +Shklovsky +Shohei +Shubham +Simpsons +Siri +Skaffold +Sketchfab +Smartbuy +Smaug +Statcast +Storrer +Strappy +Surampudi +Suzaka +Syunik +TARG +TCEHY +TGI +TLDR +TOKENLIST +TPU +TPUs +TSLA +TSMC +TSNE +Tadao +Tafel +Tbk +Tbl +Tencent +Testables +Tetsuo +Tianli +Tianxiang +Tolkien +Tongsheng +Topolino +Traceloop +Trapp +Tribbiani +Tricyle +UDF +UDFs +USERDATA +Unimicron +Upserting +Urs +Usain +Uszkoreit +Utik +VAPO +VFT +VMs +VOS +VQA +VRAM +VREDRAW +VSC +VSJ +VSPM +Valtteri +Vandamm +Vandoorne +Vaswani +Vayots +Vergadia +Verilog +Ves +Vettel +Vijay +Virat +Viru +VirusTotal +WAI +WDIR +WFH +WNDCLASS +WXGA +Wakatipu +Weaviate +Wehn +Wehrlein +Welwyn +Wnd +Womens +XGA +XSum +XXE +Xiang +YAjjpd +Youxi +Yuxuan +Yuzuru +Zakarids +Zhao +Zhaohua +Zhu +Zijin +Zom +Zscaler +Zuercher +aadd +aaxis +acall +achat +acomplete +aexecute +aextract +afrom +agentic +ainit +ainvoke +aip +airlume +akka +alloydb +antiword +apikey +apikeys +appspot +appuser +apredict +aquery +arXiv +arange +aretrieve +argmax +arguana +arun +arxiv +astype +autoflake +autogen +automerge +automl +autoptr +autorater +autosxs +aworkflow +backticks +bagchi +barmode +barpolar +baxis +bbc +beir +bff +bigframes +bigquery +bitcoin +blogs +bluesky +bml +bnb +booktitle +boundings +bpa +bpd +bqdf +bqml +breakroom +btn +byor +carbonara +catus +caudatus +caxis +cce +cctv +cer +cfbundle +chatbots +chipsets +chromadb +cicd +cimg +ckpts +claude +clf +clickable +cloudrun +cloudveil +clsx +cmap +cnf +codebase +codebases +codefile +codehaus +codelab +codelabs +coderag +codespell +colab +coldline +coloraxis +colorbar +colorway +colvis +colwidth +constexpr +corpuses +countplot +cpet +csa +cse +ctd +cupertino +cva +cygpath +darkgrid +dask +dataframe +datname +dbadmin +dbln +dcg +ddbb +ddl +deepeval +demouser +dente +descgen +deskmates +dfs +dino +direnv +diy +dlp +docai +docstore +docstores +doi +dotprompt +dpi +draig +drinkware +dropdown +dropna +dsl +dtype +dtypes +dumfries +dwmapi +ecommerce +ekg +elinks +elous +emb +embs +embvs +emojis +ename +encanta +endblock +endlocal +engi +envrc +envsubst +epath +epoc +erlang +erty +etf +etils +eur +evals +expl +faiss +fastapi +fda +fea +fect +fewshot +ffi +figsize +fillmode +fillna +fiqa +firestore +fixmycar +flac +floormat +fmeasure +fontdict +footwell +forno +fos +freedraw +freopen +fromarray +fromiter +fsspec +fts +fulltext +fullurl +functiona +funtion +gapic +gauff +gboolean +gbq +gce +gchar +gcloud +gcp +gcs +gcsfs +gdk +gdkx +genai +genkit +genwealth +geocoded +getconn +getdata +getexif +getparent +gfile +gidiyor +github +gitleaks +gke +glowin +gms +googler +goooooood +gpg +gpt +gpu +gradio +gradlew +gridcolor +grpcio +gshoe +gspread +gsutil +gtk +guanciale +gunicorn +hadolint +hashtag +hashtags +hdfs +hdlr +heatmap +heatmapgl +hexsha +hnsw +hotpotqa +hovermode +https +httpx +hwnd +iban +icudtl +idcg +idk +idks +idxs +ience +ifidx +iloc +imagefont +imageno +imagetext +imdb +imshow +inbox +informati +iostream +ipd +iphoneos +ipykernel +ipynb +isa +itable +itables +iterrows +ivf +ivfflat +ixed +ized +javac +jegadesh +jetbrains +jit +jiwer +jsonify +jsonlines +jupyter +jvm +kaggle +kenleejr +keras +keychain +kfp +kickstart +kotlin +kpi +lakecolor +landcolor +langchain +langgraph +lebron +lego +lenzing +levelname +lexer +linalg +linecolor +linestyle +linkedin +linted +linting +llm +llms +loghub +logparser +logprobs +lolcat +lparam +lru +lsb +lxml +lycra +magika +mahut +makeover +mapbox +maskmode +mavenrc +maxcold +mbsdk +mdc +mec +meme +memes +metadatas +metaverse +mgrs +millis +miranda +mmarco +mmr +morty +moviepy +mpe +mpld +mpn +mrag +mrr +mrtydi +msmarco +multitool +mvn +mvnw +mvp +mwouts +myaccount +mydb +mydomain +nanswer +nas +nbconvert +nbfmt +nbformat +nbviewer +nce +ncols +ndarray +ndcg +neering +netif +newaxis +newaxisngram +nfcorpus +ngram +ngrams +nlp +nmade +nmilitary +noabe +nobserved +nodularis +norigin +notetaker +novnc +noxfile +nrows +ntheory +nunique +nvidia +oai +objc +ollama +olleh +onesie +onesies +openai +openfda +osm +osx +outro +overwiew +owlbot +oxml +pagemap +paleo +pancetta +pantarba +paracord +parcoords +passwort +pastiched +payslip +paystub +pbxproj +pdfminer +pdfs +petabytes +pfas +pgadmin +pgvector +pietra +pii +pincodes +pixmap +pkl +playlists +plotly +plpgsql +plt +podcast +podcasts +podfile +podhelper +powerups +prcntg +preds +produc +programar +projectid +proname +protobuf +pstotext +pubmed +pubspec +putalpha +putdata +pvc +pyautogen +pybind +pydantic +pydub +pymupdf +pypdf +pyplot +pysftp +pyvis +qna +qrel +qrels +quadrotor +qubit +qubits +quippy +ragas +ragdemos +rahhhrr +ramen +rapideval +rarian +rarians +ratelimit +rbc +rbf +reddit +redef +rembg +repreve +requestz +reranked +reranker +reranking +reranks +resil +ribeye +ricc +ringspun +roboto +rpet +rrf +rsc +rsp +runjdwp +saaagesh +saveddir +scann +scattergl +scidocs +scifact +scikit +seaborn +seatback +selectbox +selkirk +seo +setlocal +sft +shortdesc +showarrow +showlakes +showland +showor +showtime +showtimes +siglap +signings +simage +sittin +sklearn +sku +slf +snowboard +sourced +srlimit +ssd +ssh +ssml +ssn +ssr +stdcall +stext +stp +strdupv +streamlit +strfreev +stt +stuffie +subviews +subword +supima +svm +sxs +tabular +tagline +tavily +tencel +termcolor +terraform +texting +textno +tfhub +tfidf +tfvars +tgz +thelook +throug +tiktoken +timechart +tion +titlebar +tobytes +toself +toset +tqdm +traceloop +treeah +tritan +trl +tseslint +tsne +tsv +tts +tures +typehints +ubuntu +uids +undst +unigram +unrtf +upsell +urandom +usebackq +usecases +username +usernames +uuids +uvb +uvicorn +vais +vapo +vectoral +vectordb +vertexai +vesselin +vnc +vtotal +vulnz +waterjet +wcontext +wcslen +wdir +weaviate +webclient +webpage +webpages +websites +weightage +welcom +whatsapp +wiffle +wikipedia +wil +windspeed +winres +wip +wishlist +workarounds +wparam +wscore +wscores +wstring +xanchor +xaxes +xaxis +xcassets +xcconfig +xcodeproj +xcscheme +xctest +xdg +xlabel +xmltodict +xsi +xsum +xticks +xxxxxxxx +yanchor +yaxes +yaxis +ylabel +youtube +yref +ytd +yticks +zakarid +zaxis diff --git a/.github/spelling/block-delimiters.list b/.github/spelling/block-delimiters.list new file mode 100644 index 00000000..4f21922b --- /dev/null +++ b/.github/spelling/block-delimiters.list @@ -0,0 +1,15 @@ +# Public Keys +-----BEGIN PUBLIC KEY----- +-----END PUBLIC KEY----- + +# RSA Private Key +-----BEGIN RSA PRIVATE KEY----- +-----END RSA PRIVATE KEY----- + +# GPG Public Key +-----BEGIN PGP PUBLIC KEY BLOCK----- +-----END PGP PUBLIC KEY BLOCK----- + +# Certificates +-----BEGIN CERTIFICATE----- +-----END CERTIFICATE----- diff --git a/.github/spelling/candidate.patterns b/.github/spelling/candidate.patterns new file mode 100644 index 00000000..827c7ea4 --- /dev/null +++ b/.github/spelling/candidate.patterns @@ -0,0 +1,675 @@ +# marker to ignore all code on line +^.*/\* #no-spell-check-line \*/.*$ +# marker to ignore all code on line +^.*\bno-spell-check(?:-line|)(?:\s.*|)$ + +# https://cspell.org/configuration/document-settings/ +# cspell inline +^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b + +# patch hunk comments +^@@ -\d+(?:,\d+|) \+\d+(?:,\d+|) @@ .* +# git index header +index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# file permissions +['"`\s][-bcdLlpsw](?:[-r][-w][-Ssx]){2}[-r][-w][-SsTtx]\+?['"`\s] + +# css url wrappings +\burl\([^)]+\) + +# cid urls +(['"])cid:.*?\g{-1} + +# data url in parens +\(data:(?:[^) ][^)]*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) +# data url in quotes +([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} +# data url +\bdata:[-a-zA-Z=;:/0-9+]*,\S* + +# https/http/file urls +(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|] + +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@._]{3,} + +# magnet urls +magnet:[?=:\w]+ + +# magnet urls +"magnet:[^"]+" + +# obs: +"obs:[^"]*" + +# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read +# In this examples content, I'm using a number of different ways to match things to show various approaches +# asciinema +\basciinema\.org/a/[0-9a-zA-Z]+ + +# asciinema v2 +^\[\d+\.\d+, "[io]", ".*"\]$ + +# apple +\bdeveloper\.apple\.com/[-\w?=/]+ +# Apple music +\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+ + +# appveyor api +\bci\.appveyor\.com/api/projects/status/[0-9a-z]+ +# appveyor project +\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+ + +# Amazon + +# Amazon +\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|) +# AWS S3 +\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]* +# AWS execute-api +\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b +# AWS ELB +\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b +# AWS SNS +\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]* +# AWS VPC +vpc-\w+ + +# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there +# YouTube url +\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]* +# YouTube music +\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*) +# YouTube tag +<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"] +# YouTube image +\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]* +# Google Accounts +\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]* +# Google Analytics +\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]* +# Google APIs +\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+ +# Google Storage +\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|) +# Google Calendar +\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+ +\w+\@group\.calendar\.google\.com\b +# Google DataStudio +\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|) +# The leading `/` here is as opposed to the `\b` above +# ... a short way to match `https://` or `http://` since most urls have one of those prefixes +# Google Docs +/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\w=&]*|)) +# Google Drive +\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]* +# Google Groups +\bgroups\.google\.com(?:/[a-z]+/(?:#!|)[^/\s"]+)* +# Google Maps +\bmaps\.google\.com/maps\?[\w&;=]* +# Google themes +themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. +# Google CDN +\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]* +# Goo.gl +/goo\.gl/[a-zA-Z0-9]+ +# Google Chrome Store +\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|) +# Google Books +\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]* +# Google Fonts +\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]* +# Google Forms +\bforms\.gle/\w+ +# Google Scholar +\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+ +# Google Colab Research Drive +\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]* + +# GitHub SHAs (api) +\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b +# GitHub SHAs (markdown) +(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) +# GitHub SHAs +\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b +# GitHub SHA refs +\[([0-9a-f]+)\]\(https://(?:www\.|)github.com/[-\w]+/[-\w]+/commit/\g{-1}[0-9a-f]* +# GitHub wiki +\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b +# githubusercontent +/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]* +# githubassets +\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+) +# gist github +\bgist\.github\.com/[^/\s"]+/[0-9a-f]+ +# git.io +\bgit\.io/[0-9a-zA-Z]+ +# GitHub JSON +"node_id": "[-a-zA-Z=;:/0-9+_]*" +# Contributor +\[[^\]]+\]\(https://github\.com/[^/\s"]+/?\) +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# GitHub actions +\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+ + +# GitLab commit +\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b +# GitLab merge requests +\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b +# GitLab uploads +\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]* +# GitLab commits +\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b + +# binance +accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* + +# bitbucket diff +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+ +# bitbucket repositories commits +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ +# bitbucket commits +\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ + +# bit.ly +\bbit\.ly/\w+ + +# bitrise +\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]* + +# bootstrapcdn.com +\bbootstrapcdn\.com/[-./\w]+ + +# cdn.cloudflare.com +\bcdnjs\.cloudflare\.com/[./\w]+ + +# circleci +\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+ + +# gitter +\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+ + +# gravatar +\bgravatar\.com/avatar/[0-9a-f]+ + +# ibm +[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]* + +# imgur +\bimgur\.com/[^.]+ + +# Internet Archive +\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*) + +# discord +/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,} + +# Disqus +\bdisqus\.com/[-\w/%.()!?&=_]* + +# medium link +\blink\.medium\.com/[a-zA-Z0-9]+ +# medium +\bmedium\.com/@?[^/\s"]+/[-\w]+ + +# microsoft +\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* +# powerbi +\bapp\.powerbi\.com/reportEmbed/[^"' ]* +# vs devops +\bvisualstudio.com(?::443|)/[-\w/?=%&.]* +# microsoft store +\bmicrosoft\.com/store/apps/\w+ + +# mvnrepository.com +\bmvnrepository\.com/[-0-9a-z./]+ + +# now.sh +/[0-9a-z-.]+\.now\.sh\b + +# oracle +\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]* + +# chromatic.com +/\S+.chromatic.com\S*[")] + +# codacy +\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+ + +# compai +\bcompai\.pub/v1/png/[0-9a-f]+ + +# mailgun api +\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]* +# mailgun +\b[0-9a-z]+.mailgun.org + +# /message-id/ +/message-id/[-\w@./%]+ + +# Reddit +\breddit\.com/r/[/\w_]* + +# requestb.in +\brequestb\.in/[0-9a-z]+ + +# sched +\b[a-z0-9]+\.sched\.com\b + +# Slack url +slack://[a-zA-Z0-9?&=]+ +# Slack +\bslack\.com/[-0-9a-zA-Z/_~?&=.]* +# Slack edge +\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+ +# Slack images +\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+ + +# shields.io +\bshields\.io/[-\w/%?=&.:+;,]* + +# stackexchange -- https://stackexchange.com/feeds/sites +\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/) + +# Sentry +[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b + +# Twitter markdown +\[@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +# Twitter hashtag +\btwitter\.com/hashtag/[\w?_=&]* +# Twitter status +\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|) +# Twitter profile images +\btwimg\.com/profile_images/[_\w./]* +# Twitter media +\btwimg\.com/media/[-_\w./?=]* +# Twitter link shortened +\bt\.co/\w+ + +# facebook +\bfburl\.com/[0-9a-z_]+ +# facebook CDN +\bfbcdn\.net/[\w/.,]* +# facebook watch +\bfb\.watch/[0-9A-Za-z]+ + +# dropbox +\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ + +# ipfs protocol +ipfs://[0-9a-zA-Z]{3,} +# ipfs url +/ipfs/[0-9a-zA-Z]{3,} + +# w3 +\bw3\.org/[-0-9a-zA-Z/#.]+ + +# loom +\bloom\.com/embed/[0-9a-f]+ + +# regex101 +\bregex101\.com/r/[^/\s"]+/\d+ + +# figma +\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+ + +# freecodecamp.org +\bfreecodecamp\.org/[-\w/.]+ + +# image.tmdb.org +\bimage\.tmdb\.org/[/\w.]+ + +# mermaid +\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+ + +# Wikipedia +\ben\.wikipedia\.org/wiki/[-\w%.#]+ + +# gitweb +[^"\s]+/gitweb/\S+;h=[0-9a-f]+ + +# HyperKitty lists +/archives/list/[^@/]+@[^/\s"]*/message/[^/\s"]*/ + +# lists +/thread\.html/[^"\s]+ + +# list-management +\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+ + +# kubectl.kubernetes.io/last-applied-configuration +"kubectl.kubernetes.io/last-applied-configuration": ".*" + +# pgp +\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]* + +# Spotify +\bopen\.spotify\.com/embed/playlist/\w+ + +# Mastodon +\bmastodon\.[-a-z.]*/(?:media/|@)[?&=0-9a-zA-Z_]* + +# scastie +\bscastie\.scala-lang\.org/[^/]+/\w+ + +# images.unsplash.com +\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+ + +# pastebin +\bpastebin\.com/[\w/]+ + +# heroku +\b\w+\.heroku\.com/source/archive/\w+ + +# quip +\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)? + +# badgen.net +\bbadgen\.net/badge/[^")\]'\s]+ + +# statuspage.io +\w+\.statuspage\.io\b + +# media.giphy.com +\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+ + +# tinyurl +\btinyurl\.com/\w+ + +# codepen +\bcodepen\.io/[\w/]+ + +# registry.npmjs.org +\bregistry\.npmjs\.org/(?:@[^/"']+/|)[^/"']+/-/[-\w@.]+ + +# getopts +\bgetopts\s+(?:"[^"]+"|'[^']+') + +# ANSI color codes +(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m + +# URL escaped characters +%[0-9A-F][A-F](?=[A-Za-z]) +# lower URL escaped characters +%[0-9a-f][a-f](?=[a-z]{2,}) +# IPv6 +\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b +# c99 hex digits (not the full format, just one I've seen) +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] +# Punycode +\bxn--[-0-9a-z]+ +# sha +sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* +# sha-... -- uses a fancy capture +(\\?['"]|")[0-9a-f]{40,}\g{-1} +# hex runs +\b[0-9a-fA-F]{16,}\b +# hex in url queries +=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?& +# ssh +#(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,} + +# PGP +\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b +# GPG keys +\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b +# Well known gpg keys +.well-known/openpgpkey/[\w./]+ + +# pki +-----BEGIN.*-----END + +# uuid: +\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b +# integrity +integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} + +# https://www.gnu.org/software/groff/manual/groff.html +# man troff content +\\f[BCIPR] +# '/" +\\\([ad]q + +# .desktop mime types +^MimeTypes?=.*$ +# .desktop localized entries +^[A-Z][a-z]+\[[a-z]+\]=.*$ +# Localized .desktop content +Name\[[^\]]+\]=.* + +# IServiceProvider / isAThing +(?:\b|_)(?:I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z]|\b)) + +# crypt +(['"])\$2[ayb]\$.{56}\g{-1} + +# scrypt / argon +\$(?:scrypt|argon\d+[di]*)\$\S+ + +# go.sum +\bh1:\S+ + +# scala imports +^import (?:[\w.]|\{\w*?(?:,\s*(?:\w*|\*))+\})+ + +# scala modules +("[^"]+"\s*%%?\s*){2,3}"[^"]+" + +# Intel intrinsics +_mm_\w+ + +# Input to GitHub JSON +content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} + +# This does not cover multiline strings, if your repository has them, +# you'll want to remove the `(?=.*?")` suffix. +# The `(?=.*?")` suffix should limit the false positives rate +# printf +#%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA]|p)(?=[a-zA-Z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) + +# Alternative printf +# %s +#%(?:s(?=[a-z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) + +# Python string prefix / binary prefix +# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings +(?|m([|!/@#,;']).*?\g{-1}) + +# perl qr regex +(?|\(.*?\)|([|!/@#,;']).*?\g{-1}) + +# perl run +perl(?:\s+-[a-zA-Z]\w*)+ + +# C network byte conversions +#(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\() + +# Go regular expressions +regexp?\.MustCompile\(`[^`]*`\) + +# regex choice +\(\?:[^)]+\|[^)]+\) + +# proto +^\s*(\w+)\s\g{-1} = + +# sed regular expressions +sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} + +# node packages +(["'])@[^/'" ]+/[^/'" ]+\g{-1} + +# go install +go install(?:\s+[a-z]+\.[-@\w/.]+)+ + +# jetbrains schema https://youtrack.jetbrains.com/issue/RSRP-489571 +urn:shemas-jetbrains-com + +# kubernetes pod status lists +# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase +\w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+ + +# kubectl - pods in CrashLoopBackOff +\w+-[0-9a-f]+-\w+\s+\d+/\d+\s+CrashLoopBackOff\s+ + +# kubernetes object suffix +-[0-9a-f]{10}-\w{5}\s + +# posthog secrets +([`'"])phc_[^"',]+\g{-1} + +# xcode + +# xcodeproject scenes +(?:Controller|destination|ID|id)="\w{3}-\w{2}-\w{3}" + +# xcode api botches +customObjectInstantitationMethod + +# msvc api botches +PrependWithABINamepsace + +# configure flags +.* \| --\w{2,}.*?(?=\w+\s\w+) + +# font awesome classes +\.fa-[-a-z0-9]+ + +# bearer auth +#(['"])[Bb]ear[e][r] .*?\g{-1} + +# bearer auth +\b[Bb]ear[e][r]:? [-a-zA-Z=;:/0-9+.]+ + +# basic auth +(['"])[Bb]asic [-a-zA-Z=;:/0-9+]{3,}\g{-1} + +# encoded-word +=\?[-a-zA-Z0-9"*%]+\?[BQ]\?[^?]{0,75}\?= + +# Time Zones +\b(?:Africa|Atlantic|America|Antarctica|Asia|Australia|Europe|Indian|Pacific)(?:/\w+)+ + +# linux kernel info +^(?:bugs|flags|Features)\s+:.* + +# systemd mode +systemd.*?running in system mode \([-+].*\)$ + +# Lorem +# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally ) +# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review - +# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into: +# ... Operation "substitution (s///)" returns its argument for non-Unicode code point 0x1C19AE (the code point will vary). +# ... You could manually change `(?i)X...` to use `[Xx]...` +# ... or you could add the files to your `excludes` file (a version after 0.0.19 should identify the file path) +(?:(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*) + +# Non-English +[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,} + +# highlighted letters +\[[A-Z]\][a-z]+ + +# French +# This corpus only had capital letters, but you probably want lowercase ones as well. +\b[LN]'+[a-z]{2,}\b + +# latex (check-spelling <= 0.0.21) +\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+) + +# latex (check-spelling >= 0.0.22) +\\\w{2,}\{ + +# American Mathematical Society (AMS) / Doxygen +TeX/AMS + +# File extensions +\*\.[+\w]+, + +# eslint +"varsIgnorePattern": ".+" + +# Windows short paths +[/\\][^/\\]{5,6}~\d{1,2}[/\\] + +# cygwin paths +/cygdrive/[a-zA-Z]/(?:Program Files(?: \(.*?\)| ?)(?:/[-+.~\\/()\w ]+)*|[-+.~\\/()\w])+ + +# in check-spelling@v0.0.22+, printf markers aren't automatically consumed +# printf markers +(?v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) + +# Compiler flags (Unix, Java/Scala) +# Use if you have things like `-Pdocker` and want to treat them as `docker` +#(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (Windows / PowerShell) +# This is a subset of the more general compiler flags pattern. +# It avoids matching `-Path` to prevent it from being treated as `ath` +(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})) + +# Compiler flags (linker) +,-B + +# libraries +\blib(?!rar(?:ies|y))(?=[a-z]) + +# WWNN/WWPN (NAA identifiers) +\b(?:0x)?10[0-9a-f]{14}\b|\b(?:0x|3)?[25][0-9a-f]{15}\b|\b(?:0x|3)?6[0-9a-f]{31}\b + +# iSCSI iqn (approximate regex) +\biqn\.[0-9]{4}-[0-9]{2}(?:[\.-][a-z][a-z0-9]*)*\b + +# curl arguments +\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* +# set arguments +\b(?:bash|sh|set)(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* +# tar arguments +\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ +# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long... +\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b +# macOS temp folders +/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/ +# github runner temp folders +/home/runner/work/_temp/[-_/a-z0-9]+ diff --git a/.github/spelling/excludes.txt b/.github/spelling/excludes.txt new file mode 100644 index 00000000..89e48681 --- /dev/null +++ b/.github/spelling/excludes.txt @@ -0,0 +1,116 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes +(?:^|/)(?i)COPYRIGHT +(?:^|/)(?i)LICEN[CS]E +(?:^|/)3rdparty/ +(?:^|/)chain_of_thought_react\.ipynb$ +(?:^|/)go\.sum$ +(?:^|/)package(?:-lock|)\.json$ +(?:^|/)Pipfile$ +(?:^|/)pyproject.toml +(?:^|/)requirements(?:-dev|-doc|-test|)\.txt$ +(?:^|/)vendor/ +/CODEOWNERS$ +\.a$ +\.ai$ +\.all-contributorsrc$ +\.avi$ +\.bmp$ +\.bz2$ +\.cer$ +\.class$ +\.coveragerc$ +\.crl$ +\.crt$ +\.csr$ +\.dll$ +\.docx?$ +\.drawio$ +\.DS_Store$ +\.eot$ +\.eps$ +\.exe$ +\.gif$ +\.git-blame-ignore-revs$ +\.gitattributes$ +\.gitkeep$ +\.graffle$ +\.gz$ +\.icns$ +\.ico$ +\.jar$ +\.jks$ +\.jpe?g$ +\.key$ +\.lib$ +\.lock$ +\.map$ +\.min\.. +\.mo$ +\.mod$ +\.mp[34]$ +\.o$ +\.ocf$ +\.otf$ +\.p12$ +\.parquet$ +\.pdf$ +\.pem$ +\.pfx$ +\.png$ +\.psd$ +\.pyc$ +\.pylintrc$ +\.qm$ +\.s$ +\.sig$ +\.so$ +\.svgz?$ +\.sys$ +\.tar$ +\.tgz$ +\.tiff?$ +\.ttf$ +\.wav$ +\.webm$ +\.webp$ +\.woff2?$ +\.xcf$ +\.xlsx?$ +\.xpm$ +\.xz$ +\.zip$ +^\.github/actions/spelling/ +^\Q.github/workflows/spelling.yaml\E$ +^\Q.github/workflows/notebook_linter/run_linter.sh\E$ +^\Q.github/workflows/linter.yaml\E$ +^\Qgemini/use-cases/education/use_cases_for_education.ipynb\E$ +^\Qgemini/evaluation/legacy/evaluate_gemini_with_autosxs_custom_task.ipynb\E$ +^\Qgemini/sample-apps/image-bash-jam/gemini-explain-image-italian.sh\E$ +^\Qgemini/sample-apps/image-bash-jam/tts.sh\E$ +^\Qgemini/use-cases/document-processing/sheet_music.ipynb\E$ +^\Qgemini/function-calling/use_case_company_news_and_insights.ipynb\E$ +^\Qgemini/getting-started/intro_gemini_1_5_pro.ipynb\E$ +^\Qgemini/getting-started/intro_gemini_pro_vision_python.ipynb\E$ +^\Qgemini/getting-started/intro_gemini_python.ipynb\E$ +^\Qgemini/reasoning-engine/tutorial_google_maps_agent.ipynb\E$ +^\Qgemini/sample-apps/image-bash-jam/images/.keep\E$ +^\Qgemini/sample-apps/image-bash-jam/README.md\E$ +^\Qgemini/sample-apps/photo-discovery/app/linux/CMakeLists.txt\E$ +^\Qgemini/sample-apps/photo-discovery/app/windows/CMakeLists.txt\E$ +^\Qgemini/use-cases/applying-llms-to-data/using-gemini-with-bigquery-remote-functions/src/sql/provision_text_sample_table.sql\E$ +^\Qgemini/use-cases/healthcare/react_gemini_healthcare_api.ipynb\E$ +^\Qgemini/use-cases/intro_multimodal_use_cases.ipynb\E$ +^\Qgemini/use-cases/retrieval-augmented-generation/intro_multimodal_rag.ipynb\E$ +^\Qgemini/use-cases/retail/product_attributes_extraction.ipynb\E$ +^\Qlanguage/use-cases/marketing-image-overlay/marketing_image_overlay.ipynb\E$ +^\Qsearch/bulk-question-answering/bulk_question_answering_output.tsv\E$ +^\Qvision/getting-started/image_editing_maskmode.ipynb\E$ +^\Qvision/getting-started/image_generation.ipynb\E$ +^\Qvision/getting-started/visual_captioning.ipynb\E$ +^\Qvision/use-cases/creating_high_quality_visual_assets_with_gemini_and_imagen.ipynb\E$ +^\Qgemini/orchestration/llamaindex_workflows.ipynb\E$ +ignore$ +^\Qworkshops/ai-agents/ai_agents_for_engineers.ipynb\E$ +^\Qowlbot.py\E$ +^\Q.github/workflows/issue_assigner/assign_issue.py\E$ +^\Qnoxfile.py\E$ diff --git a/.github/spelling/expect.txt b/.github/spelling/expect.txt new file mode 100644 index 00000000..e69de29b diff --git a/.github/spelling/line_forbidden.patterns b/.github/spelling/line_forbidden.patterns new file mode 100644 index 00000000..ae385deb --- /dev/null +++ b/.github/spelling/line_forbidden.patterns @@ -0,0 +1,311 @@ +# reject `m_data` as VxWorks defined it and that breaks things if it's used elsewhere +# see [fprime](https://github.com/nasa/fprime/commit/d589f0a25c59ea9a800d851ea84c2f5df02fb529) +# and [Qt](https://github.com/qtproject/qt-solutions/blame/fb7bc42bfcc578ff3fa3b9ca21a41e96eb37c1c7/qtscriptclassic/src/qscriptbuffer_p.h#L46) +#\bm_data\b + +# Were you debugging using a framework with `fit()`? +# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, +# you might not want to check in code where you skip all the other tests. +#\bfit\( + +# Should be `HH:MM:SS` +\bHH:SS:MM\b + +# Should be `86400` (seconds in a standard day) +\b84600\b(?:.*\bday\b) + +# Should probably be `2006-01-02` (yyyy-mm-dd) +\b2006-01-02\b + +# Should probably be `YYYYMMDD` +\b[Yy]{4}[Dd]{2}[Mm]{2}(?!.*[Yy]{4}[Dd]{2}[Mm]{2}).*$ + +# Should be `anymore` +\bany more[,.] + +# Should be `cannot` (or `can't`) +# See https://www.grammarly.com/blog/cannot-or-can-not/ +# > Don't use `can not` when you mean `cannot`. The only time you're likely to see `can not` written as separate words is when the word `can` happens to precede some other phrase that happens to start with `not`. +# > `Can't` is a contraction of `cannot`, and it's best suited for informal writing. +# > In formal writing and where contractions are frowned upon, use `cannot`. +# > It is possible to write `can not`, but you generally find it only as part of some other construction, such as `not only . . . but also.` +# - if you encounter such a case, add a pattern for that case to patterns.txt. +\b[Cc]an not\b + +# Should be `GitHub` +(?v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) + +# hit-count: 19 file-count: 10 +# Python string prefix / binary prefix +# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings +(?"'`=(])-(?:(?:J-|)[DPWXY]|[Ll]|f(?!ix))(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# hit-count: 7 file-count: 7 +# set arguments +\b(?:bash|sh|set)(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* + +# hit-count: 7 file-count: 5 +# hex runs +\b[0-9a-fA-F]{16,}\b + +# hit-count: 4 file-count: 2 +# kubernetes pod status lists +# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase +\w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+ + +# hit-count: 1 file-count: 1 +# integrity +integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} + +# hit-count: 1 file-count: 1 +# curl arguments +\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* + +# pom.xml id fields +<\w+Id>[^<]+]*>|[^<]*)\s*$ + +# Autogenerated revert commit message +^This reverts commit [0-9a-f]{40}\.$ + +# ignore long runs of a single character: +\b([A-Za-z])\g{-1}{3,}\b + +# hit-count: 40 file-count: 8 +# Non-English +[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,} + +# hit-count: 22 file-count: 1 +# ANSI color codes +(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m + +# hit-count: 15 file-count: 3 +# base64 encoded content +([`'"])[-a-zA-Z=;:/0-9+]{3,}=\g{-1} + +# hit-count: 11 file-count: 2 +# c99 hex digits (not the full format, just one I've seen) +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] + +# hit-count: 10 file-count: 8 +# IServiceProvider / isAThing +(?:\b|_)(?:I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z]|\b)) + +# hit-count: 6 file-count: 1 +# in check-spelling@v0.0.22+, printf markers aren't automatically consumed +# printf markers +(? tuple[str, bool]: + """Fixes links in a markdown cell and returns the updated source.""" + new_lines = [] + changes_made = False + + encoded_url = urllib.parse.quote(f"{GITHUB_URL_PREFIX}{relative_notebook_path}") + + for line in cell_source.splitlines(): + for key, prefix in LINK_PREFIXES.items(): + if prefix not in line or "**NOTE:**" in line: + continue + + start_index = line.find(prefix) + len(prefix) + end_index = line.find(".ipynb", start_index) + len(".ipynb") + correct_link = "" + + if key in {"colab_link", "github_link"}: + correct_link = relative_notebook_path + elif key == "colab_enterprise_link": + correct_link = urllib.parse.quote( + f"{RAW_URL_PREFIX}{relative_notebook_path}", + safe=":", + ) + elif key == "workbench_link": + correct_link = f"{RAW_URL_PREFIX}{relative_notebook_path}" + elif key == "bigquery_studio_link": + correct_link = f"{GITHUB_URL_PREFIX}{relative_notebook_path}" + elif key in { + "linkedin_link", + "bluesky_link", + "twitter_link", + "reddit_link", + "facebook_link", + }: + correct_link = encoded_url + + if correct_link.lower() not in line.lower(): + print(f"Incorrect link in {relative_notebook_path}: {line}\n") + print(f"Should be: {correct_link}\n") + line = line.replace(line[start_index:end_index], correct_link) + changes_made = True + + new_lines.append(line) + + return "\n".join(new_lines), changes_made + + +def fix_links_in_notebook(notebook_path: str) -> int: + """Fixes specific types of links in a Jupyter notebook.""" + with open(notebook_path, encoding="utf-8") as f: + notebook = nbformat.read(f, as_version=4) + + relative_notebook_path = os.path.relpath(notebook_path, start=os.getcwd()).lower() + + for cell in notebook.cells: + if cell.cell_type == "markdown" and " None: + """Recursively processes all notebooks in a directory.""" + for root, _, files in os.walk(directory_path): + for filename in files: + if filename.endswith(".ipynb"): + notebook_path = os.path.join(root, filename) + fix_links_in_notebook(notebook_path) + + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python update_notebook_links.py ") + sys.exit(1) + process_directory(sys.argv[1])