diff --git a/.github/actions/spell-check/Dockerfile b/.github/actions/spell-check/Dockerfile new file mode 100644 index 0000000000..e9e6a88c92 --- /dev/null +++ b/.github/actions/spell-check/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.9-slim-buster + +LABEL "com.github.actions.name"="WTH Spell Check Action" +LABEL "com.github.actions.description"="Check spelling of Markdown files in the WhatTheHack repo" +LABEL "com.github.actions.icon"="clipboard" +LABEL "com.github.actions.color"="green" +LABEL "repository"="http://github.com/whatthehack" +LABEL "homepage"="http://github.com/actions" + +RUN apt-get update \ + && apt-get install -y aspell hunspell wget + +RUN wget https://github.com/mikefarah/yq/releases/download/v4.30.7/yq_linux_amd64 -O /usr/bin/yq && \ + chmod +x /usr/bin/yq + +RUN pip3 install pyspelling pyyaml + +COPY generate-spellcheck.py /generate-spellcheck.py +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/spell-check/README.md b/.github/actions/spell-check/README.md new file mode 100644 index 0000000000..9c50efc5c6 --- /dev/null +++ b/.github/actions/spell-check/README.md @@ -0,0 +1 @@ +# wth-spell-check-action \ No newline at end of file diff --git a/.github/actions/spell-check/action.yml b/.github/actions/spell-check/action.yml new file mode 100644 index 0000000000..75fe067b3e --- /dev/null +++ b/.github/actions/spell-check/action.yml @@ -0,0 +1,26 @@ +name: "WTH Spell Check" +description: "A Github Action that spell checks the Markdown files in the WTH repository" +author: Jordan Bean +inputs: + spell_check_yaml_path: + description: "Path to the spell check yaml file" + required: true + default: ".github/workflows/spellcheck.yml" + markdown_base_path: + description: "Path to the markdown files" + required: true + default: "." + changed_files: + description: "Files changed in the PR (space separated)" + required: true + default: "" +branding: + color: green + icon: type +runs: + using: docker + image: "Dockerfile" + args: + - ${{ inputs.spell_check_yaml_path }} + - ${{ inputs.markdown_base_path }} + - ${{ inputs.changed_files }} diff --git a/.github/actions/spell-check/entrypoint.sh b/.github/actions/spell-check/entrypoint.sh new file mode 100644 index 0000000000..2d4f45c4d3 --- /dev/null +++ b/.github/actions/spell-check/entrypoint.sh @@ -0,0 +1,31 @@ +#!/bin/bash -l + +echo "Starting..." +configFile="$1"; shift +pathToMarkdownFiles="$1"; shift +changedFiles=("$@") + +echo "Config file: $configFile" +echo "Path to markdown files: $pathToMarkdownFiles" +echo "Changed files: ${changedFiles[@]}" + +echo "Setup languages and spelling tool..." + +python /generate-spellcheck.py "$configFile" "$pathToMarkdownFiles" "${changedFiles[@]}" + +# convert from JSON to YAML +yq -P "$configFile".tmp > "$configFile" + +rm -rf /var/lib/apt/lists/* + +echo "Using PySpelling according to configuration from $configFile" + +pyspelling --config "$configFile" + +EXITCODE=$? + +test $EXITCODE -gt 1 && echo "Spelling check action failed, please check logs."; + +test $EXITCODE -eq 1 && echo "Files in repository contain spelling errors. Please fix these errors. Alternatively, follow the instructions at the following link to add your own words to the dictionary: https://microsoft.github.io/WhatTheHack/CONTRIBUTING.html#spell-check"; + +exit $EXITCODE \ No newline at end of file diff --git a/.github/actions/spell-check/generate-spellcheck.py b/.github/actions/spell-check/generate-spellcheck.py new file mode 100644 index 0000000000..18f42113fc --- /dev/null +++ b/.github/actions/spell-check/generate-spellcheck.py @@ -0,0 +1,40 @@ +import sys +import os +import yaml +import json + +CUSTOM_WORD_LIST_FILENAME = '.wordlist.txt' + +def find_wordlist_files(path): + wordlist_paths = [] + for root, dirs, files in os.walk(path): + for file in files: + if file.endswith(CUSTOM_WORD_LIST_FILENAME): + wordlist_paths.append(os.path.join(root, file)) + return wordlist_paths + +if __name__ == '__main__': + spell_check_yaml_path = sys.argv[1] + markdown_base_path = sys.argv[2] + changed_files_tmp = sys.argv[3:] + # the changed files come in as a list with a single element, each of which is space-separated in the first element + # therefore, we need to split them + changed_files = changed_files_tmp[0].split(' ') + + spell_check_yaml = None + + with open(spell_check_yaml_path, 'r') as read_file: + spell_check_yaml = yaml.load(read_file, Loader=yaml.FullLoader) + + wordlist_paths = find_wordlist_files(markdown_base_path) + + # Add any custom wordlists defined to the spellcheck config + spell_check_yaml['matrix'][0]['dictionary']['wordlists'].extend(wordlist_paths) + + # Set the list of files to check + spell_check_yaml['matrix'][0]['sources'] = changed_files + + with open(spell_check_yaml_path + ".tmp", 'w') as write_file: + #yaml.dump doesn't work in Python >3, so we dump to JSON instead & convert using yq in the outer script + #yaml.dump(write_file, spell_check_yaml, Dumper=yaml.Dumper) + json.dump(spell_check_yaml, write_file, indent=4) \ No newline at end of file diff --git a/.github/workflows/spell-check-markdown.yml b/.github/workflows/spell-check-markdown.yml new file mode 100644 index 0000000000..f4d68bb2ee --- /dev/null +++ b/.github/workflows/spell-check-markdown.yml @@ -0,0 +1,28 @@ +name: Spell Check + +on: + pull_request: + types: + - opened + - synchronize + branches: [master] + paths: + - "**.md" + +jobs: + spell-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@ce810b29b28abf274afebdcd8fe47b8fba0f28bd + with: + files: | + **/*.md + - uses: ./.github/actions/spell-check + name: WTH Spell Check + with: + spell_check_yaml_path: .github/workflows/spell-check/spellcheck.yml + markdown_base_path: . + changed_files: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/.github/workflows/spell-check/.wordlist.txt b/.github/workflows/spell-check/.wordlist.txt new file mode 100644 index 0000000000..061ef04fe8 --- /dev/null +++ b/.github/workflows/spell-check/.wordlist.txt @@ -0,0 +1,658 @@ +AAD +ABAP +ACG +ACI +ACR +ADAL +ADF +ADFS +ADLS +ADO +AES +AGIC +AIB +AKS +ALM +ANF +APIM +APIs +ARM +ARO +ASA +ASG +ASR +AVD +AWS +ActiveDirectory +AdventureWorks +Analytics +Analytics +Ansible +AnyCAST +ApiManagement +AppGW +AppInsights +ApplicationGateway +ApplicationInsights +AspNet +AspNetCore +AutoML +Autoscale +Autoscaler +AzCopy +Azure +AzureAD +AzureCLI +AzureFunction +AzureFunctionApp +AzureFunctionApps +AzureFunctions +AzureML +AzureSearch +BCDR +BGP +BSON +BYOK +BYOL +Bing +Bing +Bootcamp +CD +CDN +CDNs +CDO +CEO +CES +CI +CICD +CIDR +CIO +CLA +CNAME +CNI +CODEOWNERS +CORS +CPU +CPUs +CSP +CSR +CSRs +CSV +CSX +CTAS +CTO +CamelCase +CentOS +ChatBot +CircleCI +ClientId +ClientSecret +CloudEvent +CloudEvents +ClusterIp +CmdLet +CmdLets +CoE +CodeQL +ConfigMap +ConnectionString +ContainerRegistry +Contoso +Cortana +Cosmos +CosmosDB +Covid +CronJob +DBA +DBAs +DBMS +DBs +DEK +DES +DICOM +DNAT +DNS +DS +DSC +DSVM +DTU +DTUs +DVW +DW +Databricks +Datadog +Dataflow +Dataverse +Dependabot +DevOps +DevSecOps +DirectQuery +Dockerfile +Dockerfiles +Dockerize +DocumentDB +EKS +EOF +ETL +EntityFramework +Ethernet +EventHub +EventHubs +Excel +ExpressRoute +FHIR +FQDN +FQDNs +FSLogix +FastTrack +FileStorage +FirstName +FluentD +FrontDoor +GCP +GDPR +GKE +GPL +GRS +GUID +GiB +Git +GitFlow +GitHub +GitOps +Gradle +Grafana +HDInsight +HIPAA +HSM +HSMs +HammerDB +Hana +Hashicorp +HealthCheck +HostPool +HostPools +HttpClient +IAM +IIS +IP +IPAddress +IPSEC +IPs +ISA +ISE +IaC +IaaS +InstrumentationKey +IntelliJ +Intellisense +Intune +IoT +IoTEdge +IoTEdge +IoTHub +JDBC +JDK +JMeter +JObject +JRE +JSON +JWT +Jaeger +JavaScript +JsonConvert +Jupyter +KEDA +Kafka +Kanban +Kepware +KeyVault +Kibana +Kubernetes +Kusto +LA +LLC +LOC +LRS +LTS +LastName +LinkedIn +LinkerD +Linq +Linux +LoadBalancer +LogLevel +MLOps +MPLS +MQTT +MSAL +MSDN +MSFT +MSI +MSIX +MSSQL +MVC +MVVM +Microsoft +Mongo +MongoDB +MySQL +NAT +NFS +NIC +NIC +NICs +NLP +NPM +NSG +NSGs +NVA +NVAs +Nano +NetApp +NetWeaver +Newtonsoft +NoSQL +NodeJS +NuGet +OAuth +OCI +OData +OLAP +OLTP +ONNX +OOF +OPC +OPCPublisher +OSS +OU +ObjectId +Ok +OnMicrosoft +OnSelect +OneDrive +OneNote +OpenAPI +OpenIDConnect +OpenShift +Owin +PBIX +PCI +PCL +PFX +PID +PII +PIP +PIPs +PLC +POC +POSIX +PPT +PR +PRs +PVCs +PVs +PaaS +Parquet +PhoneNumber +PoC +PostgreSQL +Postgres +PowerApp +PowerApps +PowerBI +PowerFX +PowerPoint +PowerShell +Prebuild +PrincipalId +PrivateEndpoint +PrivateLink +Prometheus +PuTTY +PublicIp +PullRequest +PyBuilder +PyPI +QnA +RBAC +RDP +README +RHEL +RPO +RSA +RTO +RabbitMQ +RazorPages +ReadLine +RedHat +Redis +Redux +ResourceAlias +ResourceGroup +ResourceGroupName +ResourceId +Runbook +Runbooks +Runtime +SAML +SAS +SCM +SDK +SDKs +SDLC +SDWAN +SHA +SIEM +SKU +SKUs +SLA +SLAs +SMB +SME +SMS +SMTP +SP +SPN +SQL +SQLDB +SSIS +SSL +SSMS +SSO +STG +SaaS +Schemas +Serverless +ServiceBus +SignalR +SkuName +Skype +SqlMI +StackOverflow +StateStore +StatefulSet +StorageAccountName +StorageClass +SubscriptionId +Swagger +Sybase +Synapse +TBD +TDE +TFS +TLS +TODO +TPS +TSV +TailwindInventory +TenantId +Terraform +TextBox +TextWriter +TimeSeries +ToString +Traefik +TrustFramework +TypeScript +UDR +UDRs +UI +UPN +URI +USERPROFILE +UUID +UWP +UX +Ubuntu +UbuntuLTS +VHD +VHDx +VM +VM's +VMSS +VMs +VPN +VPN +VPNs +VSCode +VSTS +VWAN +VisualStudio +WAF +WSL +WVD +WebApp +WebSocket +Webhook +WhatTheHack +WriteLine +XBox +ZRS +ZoneName +addon +addons +ai +api +appsettings +args +async +auth +authn +authz +awk +az +azurewebsites +backend +backends +backgroundColor +bacpac +balancer +bluegreen +cd +certbot +charset +chatbots +checkin +chmod +cli +clusterName +cmd +compatibility +conf +config +config +const +containerPort +cp +cron +crontab +crontabs +csharp +csproj +css +ctrl +customizable +dacpac +datacenter +dataframes +dataset +datasets +declaratively +deprovision +dev +dialogs +discoverability +distro +diy +dm +docx +dotnet +dropdown +dropdowns +eBook +eShopOnWeb +eg +env +exe +failover +fcsk +fdisk +fileshare +filesystem +filesystems +foreach +frontend +fullscreen +func +gRPC +geospatial +gz +gzip +hackathon +hackathons +hardcoded +hostname +html +http +https +hyperscale +idempotency +idempotent +ie +ifconfig +ini +init +inodes +integrations +jq +js +json +jumpbox +kubeconfig +kubectl +kubenet +kustomize +lifecycle +localhost +macOS +mcr +md +mem +microservice +microservices +middleware +minikube +mins +mnt +multiuser +mv +namespace +nav +netstat +nginx +ngrok +nslookup +oid +onboarding +onprem +openSUSE +orchestrator +pdf +pdw +peering +peerings +php +pptx +pre +prebuilt +prem +prerelease +proc +programatically +programatically +ps +psql +pubsub +py +quickstart +readonly +regex +repo +repoint +repos +req +reqs +rg +rsync +runas +runtime +runtimes +sbin +scalability +scorable +scp +sed +sitename +sln +src +stateful +stderr +stdin +stdout +subfolder +subfolders +subnet +subnets +sudo +svc +svc +svg +symlink +sys +syslog +systemd +tcp +templated +testcli +timezones +tmp +toolset +tradeoffs +transpile +transpiled +tsql +tty +udp +uncheck +upsize +upskill +usb +username +usr +utf +util +vCPU +vCPUs +vCore +vNet +vNets +vi +vim +vlc +watchlists +wc +webpage +webserver +webservers +wget +wth +wthrepo +www +xargs +xml +xslx +yaml +yml +yum +zsh \ No newline at end of file diff --git a/.github/workflows/spell-check/spellcheck.yml b/.github/workflows/spell-check/spellcheck.yml new file mode 100644 index 0000000000..d6d9db3f11 --- /dev/null +++ b/.github/workflows/spell-check/spellcheck.yml @@ -0,0 +1,19 @@ +matrix: + - name: Markdown + sources: + - "README.md" + default_encoding: utf-8 + aspell: + lang: en + ignore-case: true + dictionary: + wordlists: + - ".github/workflows/spell-check/.wordlist.txt" + encoding: utf-8 + pipeline: + - pyspelling.filters.markdown: + - pyspelling.filters.html: + comments: false + ignores: + - code + - pre diff --git a/000-HowToHack/images/spell-check-fail.png b/000-HowToHack/images/spell-check-fail.png new file mode 100644 index 0000000000..f469e7e0ac Binary files /dev/null and b/000-HowToHack/images/spell-check-fail.png differ diff --git a/000-HowToHack/images/spell-check-misspelled-words.png b/000-HowToHack/images/spell-check-misspelled-words.png new file mode 100644 index 0000000000..39d11a666c Binary files /dev/null and b/000-HowToHack/images/spell-check-misspelled-words.png differ diff --git a/047-TrafficControlWithDapr/.wordlist.txt b/047-TrafficControlWithDapr/.wordlist.txt new file mode 100644 index 0000000000..32f80b9abe --- /dev/null +++ b/047-TrafficControlWithDapr/.wordlist.txt @@ -0,0 +1,20 @@ +CloudEvent +CloudEvents +Dapr +DaprClient +FineCollectionService +KMh +MailDev +Mosquitto +SpeedingViolation +TrafficControl +TrafficControlService +UseCloudEvents +VehicleRegistered +VehicleRegistrationService +VehicleState +WebAPI +collectfine +daprd +deployer +zipkin \ No newline at end of file diff --git a/047-TrafficControlWithDapr/Student/Challenge-00.md b/047-TrafficControlWithDapr/Student/Challenge-00.md index 5f4c4f5e01..0c1791f269 100644 --- a/047-TrafficControlWithDapr/Student/Challenge-00.md +++ b/047-TrafficControlWithDapr/Student/Challenge-00.md @@ -220,7 +220,7 @@ You'll create the Azure resources for the subsequent challenges using [Azure Bic az keyvault set-policy --resource-group "" --name "" --upn "dwight.k.schrute@dunder-mifflin.com" --secret-permissions get list set delete --certificate-permissions get list create delete update ``` -1. Run the following command to initalize your local Dapr environment: +1. Run the following command to initialize your local Dapr environment: ```shell dapr init diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abfe24bd72..02e34cdd2c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -172,7 +172,7 @@ When you feel your hack is finished and ready for release, this is the process w - All links work, especially the navigation links - There are no links to the WTH repo or Coach's guide from the Student guide (See the [WTH Author's Guide](./000-HowToHack/WTH-HowToAuthorAHack.md)) - All images show properly. - - Any syntax, grammar or punctuation problems that the reviewers see and want you to address. + - Any syntax, grammar or punctuation problems that the reviewers see and want you to address. See the [Spell Check section](#spell-check) for more details. - This is NOT a technical content review. As the author(s), YOU are the subject matter experts. The WTH team will trust that you have taken care of the technical bits. - **NOTE:** It is important that you take notes through-out the meeting so that you can go away, make any changes requested, and not miss anything. 1. Once you have completed any requested changes from the "pre-PR review": @@ -182,6 +182,18 @@ When you feel your hack is finished and ready for release, this is the process w - **NOTE:** Make any requested changes by continuing to commit to your fork. The PR will automatically update with your changes. You do NOT need to create a new pull request! 1. Once you have addressed any requested changes from the WTH team, the WTH team will accept and merge the PR. +### Spell Check + +A spell checker will run on each new pull request submitted and again each time additional commits are made against that pull request. It will use common English words as well as technical terms from the `.github/workflows/spell-check/.wordlist.txt` file. + +This will run on each pull request that is submitted to the `master` branch. + +![Spell Check Fail](000-HowToHack/images/spell-check-fail.png?raw=true "Spell Check Fail") + +![Spell Check Misspelled Words](000-HowToHack/images/spell-check-misspelled-words.png?raw=true "Spell Check Misspelled Words") + +If you have unique or technical words that are not already in the global `.wordlist` file, you can add your own list. Add a file called `.wordlist.txt` to your new WTH sub-directory and include all the words you want the spell checker to ignore. There should be 1 word on each line (similar to how the `.github/workflows/spell-check/.wordlist.txt` file is formatted). + ### Use Draft Pull Requests for Early Feedback If you choose not to collaborate with the WTH team via Microsoft Teams, alternatively you can use a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/). @@ -246,6 +258,4 @@ instructions provided by the bot. You will only need to do this once across all ## Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the Code of Conduct FAQ -or contact opencode@microsoft.com with any additional questions or comments. - +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the Code of Conduct FAQ or contact `opencode@microsoft.com` with any additional questions or comments.