├── .config └── dotnet-tools.json ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .editorconfig ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── dependabot.yml └── workflows │ ├── codeql.yml │ ├── codesee-arch-diagram.yml │ ├── dependency-review.yml │ └── scorecards.yml ├── .gitignore ├── .history ├── 2022-04-04_19-13-41_CoverageHistory.xml ├── 2022-04-04_21-36-42_CoverageHistory.xml ├── 2022-04-05_19-14-34_CoverageHistory.xml ├── 2022-04-07_20-04-02_CoverageHistory.xml ├── 2022-04-15_21-18-41_CoverageHistory.xml ├── 2022-04-17_21-08-27_CoverageHistory.xml ├── 2022-06-12_19-11-55_CoverageHistory.xml ├── 2022-06-12_20-59-46_CoverageHistory.xml ├── 2022-06-22_19-23-56_CoverageHistory.xml ├── 2022-06-23_18-05-40_CoverageHistory.xml ├── 2022-09-25_12-10-23_CoverageHistory.xml ├── 2022-10-11_21-29-22_CoverageHistory.xml ├── 2022-10-12_18-12-23_CoverageHistory.xml ├── 2022-11-13_19-00-41_CoverageHistory.xml └── 2024-07-20_20-26-16_CoverageHistory.xml ├── .pre-commit-config.yaml ├── .vale.ini ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── CustomAssertions.psm1 ├── Invoke-Task.ps1 ├── LICENSE ├── PSScriptAnalyzerCustomRules.psm1 ├── PSScriptAnalyzerSettings.psd1 ├── Prelude ├── Plus │ ├── Enable-Remoting.ps1 │ ├── Get-DefaultBrowser.ps1 │ ├── Get-GithubOAuthToken.ps1 │ ├── Install-SshServer.ps1 │ ├── Invoke-ListenForWord.ps1 │ ├── Invoke-ListenTo.ps1 │ ├── Invoke-NewDirectoryAndEnter.ps1 │ ├── Invoke-Normalize.ps1 │ ├── Invoke-RemoteCommand.ps1 │ ├── Measure-Readability.ps1 │ ├── New-DailyShutdownJob.ps1 │ ├── Open-Session.ps1 │ ├── README.md │ └── Remove-DailyShutdownJob.ps1 ├── Prelude.psd1 ├── Prelude.psm1 ├── bin │ ├── CommandLineInterface.dll │ ├── Coordinate.dll │ ├── Datum.dll │ ├── DirectedEdge.dll │ ├── Edge.dll │ ├── Graph.dll │ ├── Item.dll │ ├── Matrix.dll │ ├── Node.dll │ ├── PriorityQueue.dll │ ├── Spectre.Console.dll │ └── System.Runtime.dll ├── formats │ ├── Complex.Format.ps1xml │ ├── Graph.Format.ps1xml │ └── Matrix.Format.ps1xml ├── src │ ├── application.ps1 │ ├── applied.ps1 │ ├── core.ps1 │ ├── data.ps1 │ ├── graph.ps1 │ ├── matrix.ps1 │ ├── productivity.ps1 │ ├── resources │ │ ├── blank.png │ │ └── react.png │ ├── templates │ │ ├── config │ │ │ ├── crate │ │ │ ├── editor │ │ │ ├── postcss │ │ │ ├── rust │ │ │ └── webpack │ │ ├── gitkeep │ │ └── source │ │ │ ├── css_style │ │ │ ├── html_index │ │ │ ├── jest_example │ │ │ ├── jest_setup │ │ │ ├── react │ │ │ ├── app │ │ │ ├── body │ │ │ ├── footer │ │ │ ├── header │ │ │ ├── main │ │ │ └── viewer │ │ │ ├── reason │ │ │ ├── app │ │ │ └── example │ │ │ ├── rust │ │ │ ├── app │ │ │ ├── lib │ │ │ ├── utils │ │ │ └── web │ │ │ └── vanilla │ │ │ ├── app │ │ │ ├── body │ │ │ ├── footer │ │ │ ├── header │ │ │ ├── main │ │ │ ├── mn.radio.logging │ │ │ ├── mn.redux.state │ │ │ └── mn.renderer.shim │ ├── user-interface.ps1 │ └── web.ps1 └── types │ ├── Array.Types.ps1xml │ ├── FileInfo.Types.ps1xml │ ├── Hashtable.Types.ps1xml │ ├── Int.Types.ps1xml │ ├── Matrix.Types.ps1xml │ └── String.Types.ps1xml ├── README.md ├── appveyor.yml ├── codecov.yml ├── csharp ├── .gitignore ├── CommandLineInterface │ ├── CommandLineInterface.cs │ └── CommandLineInterface.csproj ├── Geodetic │ ├── Coordinate.cs │ ├── Datum.cs │ ├── Geodetic.csproj │ ├── GlobalSuppressions.cs │ └── stylecop.json ├── Graph │ ├── DirectedEdge.cs │ ├── Edge.cs │ ├── GlobalSuppressions.cs │ ├── Graph.cs │ ├── Graph.csproj │ ├── Item.cs │ ├── Node.cs │ ├── PriorityQueue.cs │ └── stylecop.json ├── Matrix │ ├── GlobalSuppressions.cs │ ├── Matrix.cs │ ├── Matrix.csproj │ └── stylecop.json ├── Performance │ ├── Performance.csproj │ └── Program.cs ├── Prelude.sln ├── Tests │ ├── Coordinate.Tests.cs │ ├── Edge.Tests.cs │ ├── GlobalSuppressions.cs │ ├── Graph.Tests.cs │ ├── Item.Tests.cs │ ├── Matrix.Tests.cs │ ├── Node.Tests.cs │ ├── PriorityQueue.Tests.cs │ ├── Tests.csproj │ └── stylecop.json └── testEnvironments.json ├── docs └── New-WebApplication.svg ├── examples ├── Compare.md └── README.md ├── kitchensink.ps1 ├── stryker-config.json ├── styles ├── Microsoft │ ├── AMPM.yml │ ├── Accessibility.yml │ ├── Acronyms.yml │ ├── Adverbs.yml │ ├── Auto.yml │ ├── Avoid.yml │ ├── ComplexWords.yml │ ├── Contractions.yml │ ├── Dashes.yml │ ├── DateFormat.yml │ ├── DateNumbers.yml │ ├── DateOrder.yml │ ├── Ellipses.yml │ ├── FirstPerson.yml │ ├── Foreign.yml │ ├── Gender.yml │ ├── GenderBias.yml │ ├── GeneralURL.yml │ ├── HeadingAcronyms.yml │ ├── HeadingColons.yml │ ├── HeadingPunctuation.yml │ ├── Headings.yml │ ├── Hyphens.yml │ ├── Negative.yml │ ├── Ordinal.yml │ ├── OxfordComma.yml │ ├── Passive.yml │ ├── Percentages.yml │ ├── Quotes.yml │ ├── RangeFormat.yml │ ├── RangeTime.yml │ ├── Ranges.yml │ ├── Semicolon.yml │ ├── SentenceLength.yml │ ├── Spacing.yml │ ├── Suspended.yml │ ├── Terms.yml │ ├── URLFormat.yml │ ├── Units.yml │ ├── Vocab.yml │ ├── We.yml │ ├── Wordiness.yml │ └── meta.json ├── Readability │ ├── AutomatedReadability.yml │ ├── ColemanLiau.yml │ ├── FleschKincaid.yml │ ├── FleschReadingEase.yml │ ├── GunningFog.yml │ ├── LIX.yml │ ├── SMOG.yml │ └── meta.json ├── Vocab │ └── Documentation │ │ └── accept.txt ├── alex │ ├── Ablist.yml │ ├── Condescending.yml │ ├── Gendered.yml │ ├── LGBTQ.yml │ ├── Press.yml │ ├── ProfanityLikely.yml │ ├── ProfanityMaybe.yml │ ├── ProfanityUnlikely.yml │ ├── README.md │ ├── Race.yml │ ├── Suicide.yml │ └── meta.json ├── proselint │ ├── Airlinese.yml │ ├── AnimalLabels.yml │ ├── Annotations.yml │ ├── Apologizing.yml │ ├── Archaisms.yml │ ├── But.yml │ ├── Cliches.yml │ ├── CorporateSpeak.yml │ ├── Currency.yml │ ├── Cursing.yml │ ├── DateCase.yml │ ├── DateMidnight.yml │ ├── DateRedundancy.yml │ ├── DateSpacing.yml │ ├── DenizenLabels.yml │ ├── Diacritical.yml │ ├── GenderBias.yml │ ├── GroupTerms.yml │ ├── Hedging.yml │ ├── Hyperbole.yml │ ├── Jargon.yml │ ├── LGBTOffensive.yml │ ├── LGBTTerms.yml │ ├── Malapropisms.yml │ ├── Needless.yml │ ├── Nonwords.yml │ ├── Oxymorons.yml │ ├── P-Value.yml │ ├── RASSyndrome.yml │ ├── README.md │ ├── Skunked.yml │ ├── Spelling.yml │ ├── Typography.yml │ ├── Uncomparables.yml │ ├── Very.yml │ └── meta.json └── write-good │ ├── Cliches.yml │ ├── E-Prime.yml │ ├── Illusions.yml │ ├── Passive.yml │ ├── README.md │ ├── So.yml │ ├── ThereIs.yml │ ├── TooWordy.yml │ ├── Weasel.yml │ └── meta.json ├── tests ├── Matrix.Tests.ps1 ├── _setup.ps1 ├── application.Tests.ps1 ├── applied.Tests.ps1 ├── core.Tests.ps1 ├── data.Tests.ps1 ├── fixtures │ ├── .env │ ├── NAV21181.txt │ ├── emma.txt │ ├── example.html │ ├── example.txt │ ├── example.xlsx │ ├── example_protected.xlsx │ ├── hosts │ ├── profiles.ini │ ├── template.txt │ └── words.json ├── graph.Tests.ps1 ├── productivity.Tests.ps1 ├── user-interface.Tests.ps1 └── web.Tests.ps1 └── util ├── Invoke-FixPesterSetup.ps1 ├── Invoke-Setup.ps1 └── Uninstall-Pester.ps1 /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-reportgenerator-globaltool": { 6 | "version": "5.3.8", 7 | "commands": [ 8 | "reportgenerator" 9 | ] 10 | }, 11 | "dotnet-format": { 12 | "version": "5.1.225507", 13 | "commands": [ 14 | "dotnet-format" 15 | ] 16 | }, 17 | "dotnet-stryker": { 18 | "version": "1.5.0", 19 | "commands": [ 20 | "dotnet-stryker" 21 | ] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/powershell:lts-ubuntu-18.04@sha256:b093384397cd45dbceb89bcaa65744ba0b3bdfce488bf89b339bb98f0563fd45 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get update \ 6 | && apt-get -y install --no-install-recommends apt-utils 2>&1 \ 7 | && apt-get -y install --no-install-recommends git procps lsb-release zsh \ 8 | && apt-get autoremove -y \ 9 | && apt-get clean -y \ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | ENV DEBIAN_FRONTEND=dialog -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "dockerfile": "Dockerfile" 4 | }, 5 | "name": "PowerShell Prelude", 6 | "customizations": { 7 | "vscode": { 8 | "extensions": [ 9 | "akamud.vscode-theme-onedark", 10 | "bierner.markdown-mermaid", 11 | "christian-kohler.path-intellisense", 12 | "cssho.vscode-svgviewer", 13 | "deerawan.vscode-faker", 14 | "emmanuelbeziat.vscode-great-icons", 15 | "formulahendry.auto-rename-tag", 16 | "GrapeCity.gc-excelviewer", 17 | "icsharpcode.ilspy-vscode", 18 | "johnpapa.vscode-peacock", 19 | "kisstkondoros.vscode-gutter-preview", 20 | "mechatroner.rainbow-csv", 21 | "ms-dotnettools.csharp", 22 | "ms-dotnettools.dotnet-interactive-vscode", 23 | "ms-dotnettools.vscode-dotnet-runtime", 24 | "ms-vscode-remote.remote-containers", 25 | "ms-vscode.atom-keybindings", 26 | "ms-vscode.azure-account", 27 | "ms-vscode.powershell", 28 | "oderwat.indent-rainbow", 29 | "rafamel.subtle-brackets", 30 | "redhat.vscode-xml", 31 | "ryanluker.vscode-coverage-gutters", 32 | "wmaurer.change-case" 33 | ] 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{ps1,psd1,psm1}] 2 | indent_style = space 3 | indent_size = 2 4 | insert_final_newline = false 5 | 6 | [*.cs] 7 | indent_style = space 8 | indent_size = 4 9 | insert_final_newline = false 10 | csharp_new_line_before_open_brace = none:error 11 | csharp_new_line_before_else = false 12 | csharp_new_line_before_catch = false 13 | csharp_new_line_before_finally = false -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: docker 4 | directory: /.devcontainer 5 | schedule: 6 | interval: daily 7 | 8 | - package-ecosystem: github-actions 9 | directory: / 10 | schedule: 11 | interval: daily 12 | 13 | - package-ecosystem: nuget 14 | directory: /csharp/CommandLineInterface 15 | schedule: 16 | interval: daily 17 | 18 | - package-ecosystem: nuget 19 | directory: /csharp/Geodetic 20 | schedule: 21 | interval: daily 22 | 23 | - package-ecosystem: nuget 24 | directory: /csharp/Graph 25 | schedule: 26 | interval: daily 27 | 28 | - package-ecosystem: nuget 29 | directory: /csharp/Matrix 30 | schedule: 31 | interval: daily 32 | 33 | - package-ecosystem: nuget 34 | directory: /csharp/Performance 35 | schedule: 36 | interval: daily 37 | 38 | - package-ecosystem: nuget 39 | directory: /csharp/Tests 40 | schedule: 41 | interval: daily 42 | -------------------------------------------------------------------------------- /.github/workflows/codesee-arch-diagram.yml: -------------------------------------------------------------------------------- 1 | # This workflow was added by CodeSee. Learn more at https://codesee.io/ 2 | # This is v2.0 of this workflow file 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request_target: 8 | types: [opened, synchronize, reopened] 9 | 10 | name: CodeSee 11 | 12 | permissions: read-all 13 | 14 | jobs: 15 | codesee: 16 | runs-on: ubuntu-latest 17 | continue-on-error: true 18 | name: Analyze the repo with CodeSee 19 | steps: 20 | - name: Harden Runner 21 | uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 22 | with: 23 | egress-policy: audit 24 | 25 | - uses: Codesee-io/codesee-action@db076ce4b205a08da4d95bbefb3e278a958a4799 # v2 26 | with: 27 | codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }} 28 | codesee-url: https://app.codesee.io 29 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | # Dependency Review Action 2 | # 3 | # This Action will scan dependency manifest files that change as part of a Pull Request, 4 | # surfacing known-vulnerable versions of the packages declared or updated in the PR. 5 | # Once installed, if the workflow run is marked as required, 6 | # PRs introducing known-vulnerable packages will be blocked from merging. 7 | # 8 | # Source repository: https://github.com/actions/dependency-review-action 9 | name: 'Dependency Review' 10 | on: [pull_request] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | dependency-review: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Harden Runner 20 | uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 21 | with: 22 | egress-policy: audit 23 | 24 | - name: 'Checkout Repository' 25 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 26 | - name: 'Dependency Review' 27 | uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Code Coverage Results 2 | coverage/ 3 | coverage.xml 4 | # Benchmark Results 5 | BenchmarkDotNet.Artifacts 6 | # Visual Studio 7 | .vs/ 8 | # VSCode Ionide 9 | .ionide/ 10 | #JetBrains 11 | csharp/.idea/ 12 | -------------------------------------------------------------------------------- /.history/2022-04-04_19-13-41_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-04-04_21-36-42_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-04-05_19-14-34_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-04-07_20-04-02_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-04-15_21-18-41_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-04-17_21-08-27_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-06-12_19-11-55_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-06-12_20-59-46_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-06-22_19-23-56_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-06-23_18-05-40_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-09-25_12-10-23_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-10-11_21-29-22_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-10-12_18-12-23_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.history/2022-11-13_19-00-41_CoverageHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/gitleaks/gitleaks 3 | rev: v8.16.3 4 | hooks: 5 | - id: gitleaks 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v4.4.0 8 | hooks: 9 | - id: end-of-file-fixer 10 | - id: trailing-whitespace 11 | -------------------------------------------------------------------------------- /.vale.ini: -------------------------------------------------------------------------------- 1 | StylesPath = styles 2 | 3 | MinAlertLevel = suggestion 4 | Vocab = Documentation 5 | 6 | Packages = Microsoft, proselint, write-good, alex, Readability 7 | 8 | [*.md] 9 | BasedOnStyles = Vale, Microsoft, proselint, write-good, alex, Readability 10 | alex.Condescending = NO 11 | alex.ProfanityUnlikely = NO 12 | write-good.E-Prime = NO 13 | write-good.So = NO 14 | write-good.Weasel = NO 15 | write-good.TooWordy = NO 16 | write-good.Passive = NO 17 | Microsoft.Passive = NO 18 | Microsoft.ComplexWords = NO 19 | Microsoft.Headings = NO 20 | Microsoft.HeadingPunctuation = NO 21 | Microsoft.FirstPerson = NO 22 | Readability.FleschReadingEase = NO 23 | Readability.LIX = NO -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "akamud.vscode-theme-onedark", 4 | "bierner.markdown-mermaid", 5 | "christian-kohler.path-intellisense", 6 | "deerawan.vscode-faker", 7 | "emmanuelbeziat.vscode-great-icons", 8 | "formulahendry.auto-rename-tag", 9 | "GrapeCity.gc-excelviewer", 10 | "icsharpcode.ilspy-vscode", 11 | "johnpapa.vscode-peacock", 12 | "kisstkondoros.vscode-gutter-preview", 13 | "mechatroner.rainbow-csv", 14 | "ms-dotnettools.csharp", 15 | "ms-dotnettools.dotnet-interactive-vscode", 16 | "ms-dotnettools.vscode-dotnet-runtime", 17 | "ms-vscode-remote.remote-containers", 18 | "ms-vscode.atom-keybindings", 19 | "ms-vscode.azure-account", 20 | "ms-vscode.powershell", 21 | "oderwat.indent-rainbow", 22 | "rafamel.subtle-brackets", 23 | "redhat.vscode-xml", 24 | "ryanluker.vscode-coverage-gutters", 25 | "wmaurer.change-case" 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "PowerShell", 9 | "request": "launch", 10 | "name": "PowerShell Launch Current File", 11 | "script": "${file}", 12 | "args": [], 13 | "cwd": "${file}" 14 | }, 15 | { 16 | "type": "PowerShell", 17 | "request": "launch", 18 | "name": "PowerShell Launch Current File in Temporary Console", 19 | "script": "${file}", 20 | "args": [], 21 | "cwd": "${file}", 22 | "createTemporaryIntegratedConsole": true 23 | }, 24 | { 25 | "type": "PowerShell", 26 | "request": "launch", 27 | "name": "PowerShell Launch Current File w/Args Prompt", 28 | "script": "${file}", 29 | "args": [ "${command:SpecifyScriptArgs}" ], 30 | "cwd": "${file}" 31 | }, 32 | { 33 | "type": "PowerShell", 34 | "request": "attach", 35 | "name": "PowerShell Attach to Host Process", 36 | "processId": "${command:PickPSHostProcess}", 37 | "runspaceId": 1 38 | }, 39 | { 40 | "type": "PowerShell", 41 | "request": "launch", 42 | "name": "Pester Tests", 43 | "script": "Invoke-Pester", 44 | "args": ["-FullNameFilter", "*Invoke-WebRequestBasicAuth*"], 45 | "cwd": "${workspaceRoot}" 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "workbench.colorCustomizations": { 3 | "activityBar.activeBackground": "#3399ff", 4 | "activityBar.activeBorder": "#bf0060", 5 | "activityBar.background": "#3399ff", 6 | "activityBar.foreground": "#15202b", 7 | "activityBar.inactiveForeground": "#15202b99", 8 | "activityBarBadge.background": "#bf0060", 9 | "activityBarBadge.foreground": "#e7e7e7", 10 | "statusBar.background": "#007fff", 11 | "statusBar.foreground": "#e7e7e7", 12 | "statusBarItem.hoverBackground": "#3399ff", 13 | "titleBar.activeBackground": "#007fff", 14 | "titleBar.activeForeground": "#e7e7e7", 15 | "titleBar.inactiveBackground": "#007fff99", 16 | "titleBar.inactiveForeground": "#e7e7e799", 17 | "sash.hoverBorder": "#3399ff", 18 | "statusBarItem.remoteBackground": "#007fff", 19 | "statusBarItem.remoteForeground": "#e7e7e7", 20 | "commandCenter.border": "#e7e7e799" 21 | }, 22 | "peacock.color": "#007fff", 23 | "editor.fontFamily" : "\"JetBrainsMono NF\"", 24 | "terminal.integrated.fontFamily": "\"JetBrainsMono NF\"", 25 | "files.exclude": { 26 | "**/*.vo": true, 27 | "**/*.vok": true, 28 | "**/*.vos": true, 29 | "**/*.aux": true, 30 | "**/*.glob": true, 31 | "**/.git": true, 32 | "**/.svn": true, 33 | "**/.hg": true, 34 | "**/CVS": true, 35 | "**/.DS_Store": true, 36 | "**/Thumbs.db": true 37 | } 38 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/csharp/Tests/Tests.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/csharp/Tests/Tests.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/csharp/Tests/Tests.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /CustomAssertions.psm1: -------------------------------------------------------------------------------- 1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('RequireDirective', '')] 2 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] 3 | Param() 4 | 5 | function Test-ObjectKeyArray { 6 | <# 7 | .SYNOPSIS 8 | Compares the keys of the input object with an expected array of values. 9 | .EXAMPLE 10 | @{ 'a' = 1; 'b' = 2; 'c' = 3 } | Should -HaveKeys @('a', 'b', 'c') 11 | .EXAMPLE 12 | @{ 'x' = 1; 'y' = 2; 'z' = 3 } | Should -not -HaveKeys @('a', 'b', 'c') 13 | #> 14 | [CmdletBinding()] 15 | Param( 16 | [PSObject] $ActualValue, 17 | [Array] $ExpectedValue, 18 | [Switch] $Negate, 19 | [String] $Because, 20 | [Management.Automation.SessionState] $CallerSessionState 21 | ) 22 | $SortedExpected = $ExpectedValue | Sort-Object 23 | $SortedActual = $ActualValue.Keys | Sort-Object 24 | $Succeeded = 0..($ExpectedValue.Count - 1) | 25 | ForEach-Object { ($SortedExpected[$_] -eq $SortedActual[$_]) } | 26 | Invoke-Reduce -Every 27 | if ($Negate) { $Succeeded = -not $Succeeded } 28 | if (-not $Succeeded) { 29 | $NegateMessage = if ($Negate) { 'NOT ' } 30 | $ExpectedMessage = "@($($ExpectedValue -join ', '))" 31 | $BecauseMessage = if ($Because) { " because ${Because}" } 32 | $FailureMessage = "Expected input object to ${NegateMessage}have keys, ${ExpectedMessage}${BecauseMessage}." 33 | } 34 | return [PSCustomObject]@{ 35 | Succeeded = $Succeeded 36 | FailureMessage = $FailureMessage 37 | } 38 | } 39 | Add-ShouldOperator -Name 'HaveKeys' -InternalName 'Test-ObjectKeyArray' -Test ${Function:Test-ObjectKeyArray} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020 Jason Wohlgemuth , All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 12 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 13 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 14 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 15 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /PSScriptAnalyzerSettings.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | ExcludeRules = @( 3 | 'PSAvoidUsingWriteHost' 4 | 'PSUseBOMForUnicodeEncodedFile' 5 | 'PSAvoidOverwritingBuiltInCmdlets' 6 | 'PSUseProcessBlockForPipelineCommand' 7 | 'PSUseShouldProcessForStateChangingFunctions' 8 | ) 9 | CustomRulePath = 'PSScriptAnalyzerCustomRules.psm1' 10 | IncludeDefaultRules = $True 11 | Rules = @{ 12 | PSAvoidGlobalFunctions = @{ 13 | Enable = $True 14 | } 15 | PSAvoidLongLines = @{ 16 | Enable = $False 17 | MaximumLineLength = 150 18 | } 19 | PSAvoidUsingDoubleQuotesForConstantString = @{ 20 | Enable = $True 21 | } 22 | PSAvoidUsingDeprecatedManifestFields = @{ 23 | Enable = $True 24 | } 25 | PSPlaceOpenBrace = @{ 26 | Enable = $True 27 | OnSameLine = $True 28 | NewLineAfter = $True 29 | IgnoreOneLineBlock = $True 30 | } 31 | PSPlaceCloseBrace = @{ 32 | Enable = $True 33 | NoEmptyLineBefore = $True 34 | IgnoreOneLineBlock = $True 35 | NewLineAfter = $False 36 | } 37 | PSUseCompatibleSyntax = @{ 38 | Enable = $True 39 | TargetVersions = @('5.1') 40 | } 41 | PSUseConsistentIndentation = @{ 42 | Enable = $True 43 | IndentationSize = 4 44 | PipelineIndentation = 'IncreaseIndentationForFirstPipeline' 45 | Kind = 'space' 46 | } 47 | PSUseConsistentWhitespace = @{ 48 | Enable = $True 49 | CheckInnerBrace = $True 50 | CheckOpenBrace = $True 51 | CheckOpenParen = $True 52 | CheckOperator = $True 53 | CheckSeparator = $True 54 | CheckParameter = $True 55 | CheckPipe = $True 56 | CheckPipeForRedundantWhitespace = $True 57 | } 58 | PSUseCorrectCasing = @{ 59 | Enable = $True 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Prelude/Plus/Enable-Remoting.ps1: -------------------------------------------------------------------------------- 1 | function Enable-Remoting { 2 | <# 3 | .SYNOPSIS 4 | Function to enable PowerShell remoting for workgroup computer 5 | .PARAMETER TrustedHosts 6 | Comma-separated list of trusted host names 7 | example: 'RED,WHITE,BLUE' 8 | .EXAMPLE 9 | Enable-Remoting 10 | .EXAMPLE 11 | Enable-Remoting -TrustedHosts 'MARIO,LUIGI' 12 | #> 13 | [CmdletBinding()] 14 | Param( 15 | [String] $TrustedHosts = '*', 16 | [Switch] $PassThru 17 | ) 18 | if (Test-Admin) { 19 | '==> [INFO] Making network private' | Write-Verbose 20 | Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private 21 | $Path = 'WSMan:\localhost\Client\TrustedHosts' 22 | '==> [INFO] Enabling PowerShell remoting' | Write-Verbose 23 | Enable-PSRemoting -Force -SkipNetworkProfileCheck 24 | '==> [INFO] Updated trusted hosts' | Write-Verbose 25 | Set-Item $Path -Value $TrustedHosts -Force 26 | if ($PassThru) { 27 | return Get-Item $Path 28 | } 29 | } else { 30 | '==> [ERROR] Enable-Remoting requires Administrator privileges' | Write-Error 31 | } 32 | } -------------------------------------------------------------------------------- /Prelude/Plus/Get-DefaultBrowser.ps1: -------------------------------------------------------------------------------- 1 | function Get-DefaultBrowser { 2 | <# 3 | .SYNOPSIS 4 | Get string name of user-selected default browser 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([String])] 8 | Param() 9 | $Path = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\' 10 | $Abbreviation = if (Test-Path -Path $Path) { 11 | (Get-ItemProperty -Path $Path).ProgId.Substring(0, 2).ToUpper() 12 | } else { 13 | '' 14 | } 15 | switch ($Abbreviation) { 16 | 'FI' { 'Firefox' } 17 | 'IE' { 'IE' } 18 | 'CH' { 'Chrome' } 19 | 'OP' { 'Opera' } 20 | Default { 'Unknown' } 21 | } 22 | } -------------------------------------------------------------------------------- /Prelude/Plus/Install-SshServer.ps1: -------------------------------------------------------------------------------- 1 | function Install-SshServer { 2 | <# 3 | .SYNOPSIS 4 | Install OpenSSH server 5 | .LINK 6 | https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse 7 | #> 8 | [CmdletBinding(SupportsShouldProcess = $True)] 9 | Param() 10 | if ($PSCmdlet.ShouldProcess('OpenSSH Server Configuration')) { 11 | Write-Verbose '==> Enabling OpenSSH server' 12 | Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 13 | Write-Verbose '==> Starting sshd service' 14 | Start-Service sshd 15 | Write-Verbose '==> Setting sshd service to start automatically' 16 | Set-Service -Name sshd -StartupType 'Automatic' 17 | Write-Verbose '==> Adding firewall rule for sshd' 18 | New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 19 | } else { 20 | '==> Would have added windows OpenSSH.Server capability, started "sshd" service, and added a firewall rule for "sshd"' | Write-Color -DarkGray 21 | } 22 | } -------------------------------------------------------------------------------- /Prelude/Plus/Invoke-ListenForWord.ps1: -------------------------------------------------------------------------------- 1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '', Scope = 'Function', Target = 'Invoke-ListenForWord')] 2 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope = 'Function', Target = 'Invoke-ListenForWord')] 3 | Param() 4 | 5 | function Invoke-ListenForWord { 6 | <# 7 | .SYNOPSIS 8 | Start loop that listens for trigger words and execute passed functions when recognized 9 | .DESCRIPTION 10 | This function uses the Windows Speech Recognition. For best results, you should first improve speech recognition via Speech Recognition Voice Training. 11 | .EXAMPLE 12 | Invoke-Listen -Triggers 'hello' -Actions { Write-Color 'Welcome' -Green } 13 | .EXAMPLE 14 | Invoke-Listen -Triggers 'hello','quit' -Actions { say 'Welcome' | Out-Null; $True }, { say 'Goodbye' | Out-Null; $False } 15 | 16 | # An action will stop listening when it returns a "falsy" value like $True or $Null. Conversely, returning "truthy" values will continue the listening loop. 17 | #> 18 | [CmdletBinding()] 19 | [Alias('listenFor')] 20 | Param( 21 | [Parameter(Mandatory = $True)] 22 | [String[]] $Triggers, 23 | [ScriptBlock[]] $Actions, 24 | [Double] $Threshhold = 0.85 25 | ) 26 | Use-Speech 27 | $Engine = Use-Grammar -Words $Triggers 28 | $Continue = $True; 29 | Write-Color 'Listening for trigger words...' -Cyan 30 | while ($Continue) { 31 | $Recognizer = $Engine.Recognize(); 32 | $Confidence = $Recognizer.Confidence; 33 | $Text = $Recognizer.text; 34 | if ($Text.Length -gt 0) { 35 | Write-Verbose "==> Heard `"$Text`"" 36 | } 37 | $Index = 0 38 | $Triggers | ForEach-Object { 39 | if ($Text -match $_ -and [Double]$Confidence -gt $Threshhold) { 40 | $Continue = & $Actions[$Index] 41 | } 42 | $Index++ 43 | } 44 | } 45 | } 46 | function Use-Grammar { 47 | <# 48 | .SYNOPSIS 49 | Create speech recognition engine, load grammars for words, and return the engine 50 | #> 51 | [CmdletBinding()] 52 | [OutputType([System.Speech.Recognition.SpeechRecognitionEngine])] 53 | Param( 54 | [Parameter(Mandatory = $True)] 55 | [String[]] $Words 56 | ) 57 | Write-Verbose '==> Creating Speech Recognition Engine' 58 | $Engine = New-Object 'System.Speech.Recognition.SpeechRecognitionEngine'; 59 | $Engine.InitialSilenceTimeout = 15 60 | $Engine.SetInputToDefaultAudioDevice(); 61 | foreach ($Word in $Words) { 62 | "==> Loading grammar for $Word" | Write-Verbose 63 | $Grammar = New-Object 'System.Speech.Recognition.GrammarBuilder'; 64 | $Grammar.Append($Word) 65 | $Engine.LoadGrammar($Grammar) 66 | } 67 | $Engine 68 | } -------------------------------------------------------------------------------- /Prelude/Plus/Invoke-NewDirectoryAndEnter.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-NewDirectoryAndEnter { 2 | <# 3 | .SYNOPSIS 4 | PowerShell equivalent of oh-my-zsh take function 5 | .DESCRIPTION 6 | Using take will create a new directory and then enter the driectory 7 | .EXAMPLE 8 | take ./new/folder/name 9 | #> 10 | [CmdletBinding(SupportsShouldProcess = $True)] 11 | [Alias('take')] 12 | Param( 13 | [Parameter(Mandatory = $True)] 14 | [String] $Name 15 | ) 16 | $Path = Join-Path (Get-Location) $Name 17 | if (Test-Path $Path) { 18 | "==> $Path exists" | Write-Verbose 19 | if ($PSCmdlet.ShouldProcess($Path)) { 20 | "==> Entering $Path" | Write-Verbose 21 | Set-Location $Path 22 | } else { 23 | "==> Would have entered $Path" | Write-Color -DarkGray 24 | } 25 | } else { 26 | if ($PSCmdlet.ShouldProcess($Path)) { 27 | "==> Creating $Path" | Write-Verbose 28 | mkdir $Path 29 | if (Test-Path $Path) { 30 | Write-Verbose "==> Entering $Path" 31 | Set-Location $Path 32 | } 33 | } else { 34 | "==> Would have created and entered $Path" | Write-Color -DarkGray 35 | } 36 | } 37 | Write-Verbose "==> pwd is $(Get-Location)" 38 | } -------------------------------------------------------------------------------- /Prelude/Plus/Invoke-Normalize.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-Normalize { 2 | <# 3 | .SYNOPSIS 4 | Return string with characters with accents replaced with plain UTF-8 counterpart (ex: "á" becomes "a") 5 | Note: Capitalization is maintained 6 | .EXAMPLE 7 | 'resumé' | Invoke-Normalize 8 | # 'resume' 9 | #> 10 | [CmdletBinding()] 11 | [OutputType([String])] 12 | Param( 13 | [Parameter(Mandatory = $True, Position = 0, ValueFromPipeline = $True)] 14 | $Text 15 | ) 16 | Begin { 17 | $CharacterMap = @{ 18 | 'ß' = 'ss' 19 | 'à' = 'a' 20 | 'á' = 'a' 21 | 'â' = 'a' 22 | 'ã' = 'a' 23 | 'ä' = 'a' 24 | 'å' = 'a' 25 | 'æ' = 'ae' 26 | 'ç' = 'c' 27 | 'è' = 'e' 28 | 'é' = 'e' 29 | 'ê' = 'e' 30 | 'ë' = 'e' 31 | 'ì' = 'i' 32 | 'í' = 'i' 33 | 'î' = 'i' 34 | 'ï' = 'i' 35 | 'ð' = 'd' 36 | 'ñ' = 'n' 37 | 'ò' = 'o' 38 | 'ó' = 'o' 39 | 'ô' = 'o' 40 | 'õ' = 'o' 41 | 'ö' = 'o' 42 | 'ø' = 'o' 43 | 'ù' = 'u' 44 | 'ú' = 'u' 45 | 'û' = 'u' 46 | 'ü' = 'u' 47 | 'ý' = 'y' 48 | } 49 | } 50 | Process { 51 | # [Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Cyrillic").GetBytes($Text)) 52 | $Output = $Text 53 | foreach ($Key in $CharacterMap.Keys) { 54 | $Output = $Output.Replace($Key, $CharacterMap.$Key).Replace($Key.ToUpper(), $CharacterMap.$Key.ToUpper()) 55 | } 56 | $Output 57 | } 58 | } -------------------------------------------------------------------------------- /Prelude/Plus/New-DailyShutdownJob.ps1: -------------------------------------------------------------------------------- 1 | function New-DailyShutdownJob { 2 | <# 3 | .SYNOPSIS 4 | Create job to shutdown computer at a certain time every day 5 | .EXAMPLE 6 | New-DailyShutdownJob -At '22:00' 7 | #> 8 | [CmdletBinding()] 9 | [OutputType([Bool])] 10 | Param( 11 | [Parameter(Mandatory = $True)] 12 | [DateTime] $At, 13 | [Switch] $PassThru 14 | ) 15 | Begin { 16 | $Result = $False 17 | $Version = $PSVersionTable.PSVersion.Major 18 | $Name = 'DailyShutdown' 19 | } 20 | End { 21 | if (Test-Admin) { 22 | if ($Version -ge 7) { 23 | "==> Creating daily shutdown task at ${At}" | Write-Verbose 24 | $ScriptBlock = 'Invoke-Command -Scriptblock { Stop-Computer -Force }' 25 | $Parameters = @{ 26 | TaskName = $Name 27 | Action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument $ScriptBlock 28 | Trigger = New-ScheduledTaskTrigger -Daily -At $At 29 | Description = "Daily shutdown at ${At}" 30 | Force = $True 31 | } 32 | Register-ScheduledTask @Parameters | Out-Null 33 | $Result = (Get-ScheduledTask -TaskName $Name).State -eq 'Ready' 34 | } else { 35 | "==> Creating daily shutdown job at ${At}" | Write-Verbose 36 | $Trigger = New-JobTrigger -Daily -At $At 37 | Register-ScheduledJob -Name $Name -ScriptBlock { Stop-Computer -Force } -Trigger $Trigger 38 | $Result = $True 39 | } 40 | } else { 41 | Write-Error "==> $($MyInvocation.MyCommand.Name) requires Administrator privileges" 42 | } 43 | if ($PassThru) { 44 | $Result 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Prelude/Plus/Open-Session.ps1: -------------------------------------------------------------------------------- 1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '', Scope = 'Function', Target = 'Open-Session')] 2 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '', Scope = 'Function', Target = 'Open-Session')] 3 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUsePSCredentialType', '', Scope = 'Function', Target = 'Open-Session')] 4 | Param() 5 | 6 | function Open-Session { 7 | <# 8 | .SYNOPSIS 9 | Create interactive session with remote computer 10 | .PARAMETER NoEnter 11 | Create session(s) but do not enter a session 12 | .EXAMPLE 13 | Open-Session -ComputerNames PCNAME -Password 123456 14 | .EXAMPLE 15 | Open-Session -ComputerNames PCNAME 16 | 17 | # Open a prompt for you to input your password 18 | .EXAMPLE 19 | $Sessions = Open-Session -ComputerNames ServerA,ServerB 20 | # This will open a password prompt and then display an interactive console menu to select ServerA or ServerB. 21 | 22 | # $Sessions will point to an array of sessions for ServerA and ServerB and can be used to make new sessions: 23 | Enter-PSSession -Session $Sessions[1] 24 | #> 25 | [CmdletBinding()] 26 | Param( 27 | [Parameter(Mandatory = $True, Position = 0, ValueFromPipeline = $True)] 28 | [String[]] $ComputerNames, 29 | [SecureString] $Password, 30 | [PSObject] $Credential, 31 | [Switch] $NoEnter 32 | ) 33 | $User = whoami 34 | if ($Credential) { 35 | Write-Verbose '==> Using -Credential for authentication' 36 | $Cred = $Credential 37 | } elseif ($Password) { 38 | Write-Verbose "==> Creating credential for $User using -Password" 39 | $Pass = ConvertTo-SecureString -String $Password -AsPlainText -Force 40 | $Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $Pass 41 | } else { 42 | $Cred = Get-Credential -Message "Please provide password to access $(Join-StringsWithGrammar $ComputerNames)" -User $User 43 | } 44 | Write-Verbose "==> Creating session on $(Join-StringsWithGrammar $ComputerNames)" 45 | $Session = New-PSSession -ComputerName $ComputerNames -Credential $Cred 46 | Write-Verbose '==> Entering session' 47 | if (-not $NoEnter) { 48 | if ($Session.Length -eq 1) { 49 | Enter-PSSession -Session $Session 50 | } else { 51 | Write-Label '{{#green Enter session?}}' -NewLine 52 | $Index = Invoke-Menu -Items $ComputerNames -ReturnIndex 53 | if ($Null -ne $Index) { 54 | Enter-PSSession -Session $Session[$Index] 55 | } 56 | } 57 | } 58 | $Session 59 | } -------------------------------------------------------------------------------- /Prelude/Plus/Remove-DailyShutdownJob.ps1: -------------------------------------------------------------------------------- 1 | function Remove-DailyShutdownJob { 2 | <# 3 | .SYNOPSIS 4 | Remove job created with New-DailyShutdownJob 5 | .EXAMPLE 6 | Remove-DailyShutdownJob 7 | #> 8 | [CmdletBinding()] 9 | [OutputType([Bool])] 10 | Param( 11 | [Switch] $PassThru 12 | ) 13 | Begin { 14 | $Result = $False 15 | $Version = $PSVersionTable.PSVersion.Major 16 | $Name = 'DailyShutdown' 17 | } 18 | End { 19 | if (Test-Admin) { 20 | if ($Version -ge 7) { 21 | "==> Removing `"${Name}`" task" | Write-Verbose 22 | Unregister-ScheduledTask -TaskName $Name -Confirm:$False 23 | } else { 24 | "==> Removing `"${Name}`" job" | Write-Verbose 25 | Unregister-ScheduledJob -Name $Name 26 | } 27 | $Result = $True 28 | } else { 29 | Write-Error "==> $($MyInvocation.MyCommand.Name) requires Administrator privileges" 30 | } 31 | if ($PassThru) { 32 | $Result 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Prelude/Prelude.psm1: -------------------------------------------------------------------------------- 1 | <# 2 | ██████╗░██████╗░███████╗██╗░░░░░██╗░░░██╗██████╗░███████╗ 3 | ██╔══██╗██╔══██╗██╔════╝██║░░░░░██║░░░██║██╔══██╗██╔════╝ 4 | ██████╔╝██████╔╝█████╗░░██║░░░░░██║░░░██║██║░░██║█████╗░░ 5 | ██╔═══╝░██╔══██╗██╔══╝░░██║░░░░░██║░░░██║██║░░██║██╔══╝░░ 6 | ██║░░░░░██║░░██║███████╗███████╗╚██████╔╝██████╔╝███████╗ 7 | ╚═╝░░░░░╚═╝░░╚═╝╚══════╝╚══════╝░╚═════╝░╚═════╝░╚══════╝ 8 | #> 9 | function Add-TypeData { 10 | Param( 11 | [Parameter(Mandatory = $True, Position = 0)] 12 | [String] $Name 13 | ) 14 | $Path = Join-Path $PSScriptRoot "bin/${Name}.dll" 15 | if (Test-Path $Path) { 16 | Add-Type -Path $Path 17 | } else { 18 | "==> [ERROR] Failed to load ${Name} type accelerators" | Write-Warning 19 | } 20 | } 21 | <# 22 | Import link libraries and create type accelarators 23 | #> 24 | $Accelerators = [PowerShell].Assembly.GetType('System.Management.Automation.TypeAccelerators') 25 | if (-not ('Complex' -as [Type])) { 26 | $Accelerators::Add('Complex', 'System.Numerics.Complex') 27 | } 28 | 'CommandLineInterface', 'Matrix', 'Node', 'Edge', 'DirectedEdge', 'Graph' | ForEach-Object { 29 | if (-not ("Prelude.${_}" -as [Type])) { 30 | Add-TypeData $_ 31 | $Accelerators::Add($_, "Prelude.${_}") 32 | } 33 | } 34 | 'Datum', 'Coordinate' | ForEach-Object { 35 | if (-not ("Prelude.Geodetic.${_}" -as [Type])) { 36 | Add-TypeData $_ 37 | $Accelerators::Add($_, "Prelude.Geodetic.${_}") 38 | } 39 | } 40 | <# 41 | Import source files 42 | #> 43 | 'src', 'Plus' | ForEach-Object { 44 | $SourceFiles = Join-Path $PSScriptRoot $_ 45 | Get-ChildItem -Path $SourceFiles -Recurse -Include *.ps1 | 46 | Sort-Object | 47 | ForEach-Object { . $_.FullName } 48 | } -------------------------------------------------------------------------------- /Prelude/bin/CommandLineInterface.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/CommandLineInterface.dll -------------------------------------------------------------------------------- /Prelude/bin/Coordinate.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Coordinate.dll -------------------------------------------------------------------------------- /Prelude/bin/Datum.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Datum.dll -------------------------------------------------------------------------------- /Prelude/bin/DirectedEdge.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/DirectedEdge.dll -------------------------------------------------------------------------------- /Prelude/bin/Edge.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Edge.dll -------------------------------------------------------------------------------- /Prelude/bin/Graph.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Graph.dll -------------------------------------------------------------------------------- /Prelude/bin/Item.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Item.dll -------------------------------------------------------------------------------- /Prelude/bin/Matrix.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Matrix.dll -------------------------------------------------------------------------------- /Prelude/bin/Node.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Node.dll -------------------------------------------------------------------------------- /Prelude/bin/PriorityQueue.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/PriorityQueue.dll -------------------------------------------------------------------------------- /Prelude/bin/Spectre.Console.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/Spectre.Console.dll -------------------------------------------------------------------------------- /Prelude/bin/System.Runtime.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/bin/System.Runtime.dll -------------------------------------------------------------------------------- /Prelude/formats/Complex.Format.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Complex-Value 6 | 7 | 8 | 9 | 10 | 11 | 12 | $_ | Format-ComplexValue -WithColor | Write-Label -Color White -Indent 2 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Complex 24 | 25 | System.Numerics.Complex 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Complex-Value 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Prelude/src/resources/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/src/resources/blank.png -------------------------------------------------------------------------------- /Prelude/src/resources/react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/src/resources/react.png -------------------------------------------------------------------------------- /Prelude/src/templates/config/crate: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "{{ RustDirectory }}" 3 | description = "Rust code to be used within {{ Name }} as WebAssembly" 4 | version = "0.1.0" 5 | authors = ["your@email"] 6 | categories = ["wasm"] 7 | edition = "2022" 8 | 9 | [lib] 10 | # "lib" is required for integration tests to see crate 11 | crate-type = ["cdylib", "lib"] 12 | path = "src/lib.rs" 13 | 14 | [profile.release] 15 | lto = true 16 | 17 | [features] 18 | # If you uncomment this line, it will enable `wee_alloc`: 19 | #default = ["wee_alloc"] 20 | default-features = ["console_error_panic_hook"] 21 | 22 | [dependencies] 23 | cfg-if = "0.1.6" 24 | console_error_panic_hook = { version = "0.1.5", optional = true } 25 | wasm-bindgen = "0.2.45" 26 | wee_alloc = { version = "0.4.2", optional = true } 27 | 28 | [dependencies.web-sys] 29 | version = "0.3.22" 30 | features = ["console"] 31 | 32 | [dev-dependencies] 33 | wasm-bindgen-test = "0.2.45" 34 | futures = "0.1.27" 35 | js-sys = "0.3.22" 36 | wasm-bindgen-futures = "0.3.22" -------------------------------------------------------------------------------- /Prelude/src/templates/config/editor: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | 4 | [*.js] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 4 8 | insert_final_newline = false 9 | max_line_length = 150 10 | trim_trailing_whitespace = true 11 | 12 | [*.json] 13 | indent_size = 2 -------------------------------------------------------------------------------- /Prelude/src/templates/config/postcss: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | map: true, 3 | parser: require('postcss-safe-parser'), 4 | plugins: [ 5 | require('stylelint')({config: {extends: 'stylelint-config-recommended'}}), 6 | require('postcss-import')(), 7 | require('postcss-preset-env')({stage: 0}), 8 | require('cssnano')(), 9 | require('postcss-reporter')({clearReportedMessages: true}) 10 | ] 11 | }; -------------------------------------------------------------------------------- /Prelude/src/templates/config/rust: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["{{ RustDirectory }}"] 3 | default-members = ["{{ RustDirectory }}"] 4 | 5 | [profile.release] 6 | opt-level = "s" 7 | lto = true 8 | codegen-units = 1 -------------------------------------------------------------------------------- /Prelude/src/templates/gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/Prelude/src/templates/gitkeep -------------------------------------------------------------------------------- /Prelude/src/templates/source/css_style: -------------------------------------------------------------------------------- 1 | /* This comment will be removed by cssnano */ 2 | @keyframes spin { 3 | from {transform:rotate(0deg);} 4 | to {transform:rotate(360deg);} 5 | } 6 | body { 7 | background-color: white; 8 | color: #777; 9 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 10 | margin: 2rem 0 4rem 0; 11 | } 12 | a { 13 | position: relative; 14 | color: #be2edd; 15 | cursor: pointer; 16 | text-decoration: none; 17 | } 18 | a::before { 19 | content: ''; 20 | position: absolute; 21 | left: 50%; 22 | bottom: 0; 23 | width: 100%; 24 | height: 2px; 25 | background-color: #be2edd; 26 | transform-origin: center; 27 | transform: translate(-50%, 0) scaleX(0); 28 | transition: transform 0.3s ease-in-out; 29 | } 30 | a:hover::before { 31 | transform: translate(-50%, 0) scaleX(1); 32 | } 33 | footer { 34 | bottom: 0; 35 | position: fixed; 36 | text-align: center; 37 | width: 100%; 38 | & > p { 39 | line-height: 0.5rem; 40 | } 41 | } 42 | header { 43 | margin: 1rem; 44 | & > p { 45 | margin: 0; 46 | } 47 | & p:first-child { 48 | font-weight: bold; 49 | } 50 | } 51 | section { 52 | font-family: sans-serif; 53 | font-size: 2rem; 54 | text-align: center; 55 | width: 100%; 56 | & img { 57 | width: 500px; 58 | } 59 | } 60 | .heart { 61 | color: red; 62 | &::before { 63 | content: '♥'; 64 | } 65 | } 66 | #logo { 67 | width: 300px; 68 | animation-name: spin; 69 | animation-duration: 10s; 70 | animation-iteration-count: infinite; 71 | animation-timing-function: linear; 72 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/html_index: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ Name }} 6 | 7 | 8 | 9 | 10 | {{= if ($WithCesium) { '' } }} 11 | 30 | 31 | 32 |
33 | 34 | -------------------------------------------------------------------------------- /Prelude/src/templates/source/jest_example: -------------------------------------------------------------------------------- 1 | const delay = duration => new Promise(resolve => { 2 | setTimeout(resolve, duration); 3 | }); 4 | 5 | describe('Example', () => { 6 | test('can pass', () => { 7 | expect(1).toEqual(1); 8 | expect(1).not.toEqual(0); 9 | }); 10 | test('can pass asynchronously', async () => { 11 | await delay(100); 12 | expect(1).toEqual(1); 13 | }); 14 | }); -------------------------------------------------------------------------------- /Prelude/src/templates/source/jest_setup: -------------------------------------------------------------------------------- 1 | class LocalStorageMock { 2 | constructor() { 3 | this.store = {}; 4 | } 5 | clear() { 6 | this.store = {}; 7 | } 8 | getItem(key) { 9 | return this.store[key] || null; 10 | } 11 | setItem(key, value) { 12 | this.store[key] = value.toString(); 13 | } 14 | removeItem(key) { 15 | delete this.store[key]; 16 | } 17 | } 18 | global.localStorage = new LocalStorageMock(); 19 | -------------------------------------------------------------------------------- /Prelude/src/templates/source/react/app: -------------------------------------------------------------------------------- 1 | import {StrictMode} from 'react'; 2 | import {hot} from 'react-hot-loader'; 3 | import PropTypes from 'prop-types'; 4 | import Header from './Header.jsx'; 5 | import Body from './Body.jsx'; 6 | import Footer from './Footer.jsx'; 7 | 8 | const App = ({name}) => 9 |
10 | 11 |
12 |
; 13 | 14 | App.propTypes = { 15 | name: PropTypes.string 16 | }; 17 | 18 | export default hot(module)(App); -------------------------------------------------------------------------------- /Prelude/src/templates/source/react/body: -------------------------------------------------------------------------------- 1 | const Body = () =>
2 | 3 |

What happens next is up to you...

4 |
; 5 | 6 | export default Body; -------------------------------------------------------------------------------- /Prelude/src/templates/source/react/footer: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | 3 | const links = { 4 | prelude: 'https://github.com/jhwohlgemuth/pwsh-prelude' 5 | }; 6 | const Footer = ({name}) => ; 9 | 10 | Footer.propTypes = { 11 | name: PropTypes.string 12 | }; 13 | 14 | export default Footer; -------------------------------------------------------------------------------- /Prelude/src/templates/source/react/header: -------------------------------------------------------------------------------- 1 | import {useState, useEffect} from 'react'; 2 | 3 | const Header = () => { 4 | const [count, setCount] = useState(0); 5 | useEffect(() => { 6 | const counter = setInterval(() => setCount(count + 1), 1000);// eslint-disable-line no-magic-numbers 7 | return () => clearInterval(counter); 8 | }); 9 | return
10 |

HMR Check

11 |

Count: {count}

12 |
; 13 | }; 14 | 15 | export default Header; -------------------------------------------------------------------------------- /Prelude/src/templates/source/react/main: -------------------------------------------------------------------------------- 1 | /** 2 | * Main entry point for application 3 | */ 4 | import {render} from 'react-dom'; 5 | import App from './components/App.jsx'; 6 | 7 | const name = '{{ Name }}'; 8 | const root = document.getElementById('root'); 9 | 10 | render(, root); 11 | 12 | if (module.hot) { 13 | module.hot.accept(() => { 14 | render(, root); 15 | }); 16 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/react/viewer: -------------------------------------------------------------------------------- 1 | import { Viewer, Entity, PointGraphics } from 'resium'; 2 | import { Cartesian3, Color } from 'cesium'; 3 | 4 | const color = Color.LIGHTGREEN; 5 | const pixelSize = 40; 6 | const position = Cartesian3.fromDegrees(-84.3104167, 35.9313056, 100); 7 | 8 | const ResiumViewer = () =>
9 | 10 | 11 | 12 | 13 | 14 |
; 15 | 16 | export default ResiumViewer; -------------------------------------------------------------------------------- /Prelude/src/templates/source/reason/app: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = () => { 3 |
{React.string("Hello World")}
4 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/reason/example: -------------------------------------------------------------------------------- 1 | /* Based on rosettacode.org/wiki/Factorial#Recursive_50 */ 2 | let rec factorial = (n) => 3 | n <= 0 4 | ? 1 5 | : n * factorial(n - 1); -------------------------------------------------------------------------------- /Prelude/src/templates/source/rust/app: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn example_test() { 3 | assert_eq!(1, 1); 4 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/rust/lib: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use web_sys::console; 3 | 4 | mod utils; 5 | 6 | #[wasm_bindgen] 7 | extern "C" { 8 | #[wasm_bindgen(js_namespace = console)] 9 | fn log(s: &str); 10 | 11 | #[wasm_bindgen(js_namespace = console, js_name = log)] 12 | fn log_f64(a: f64); 13 | } 14 | 15 | #[wasm_bindgen] 16 | pub fn init() { 17 | utils::init(); 18 | console::log_1(&JsValue::from_str("WebAssembly Initialized")); 19 | } 20 | 21 | #[wasm_bindgen(start)] 22 | pub fn main_js() -> Result<(), JsValue> { 23 | init(); 24 | Ok(()) 25 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/rust/utils: -------------------------------------------------------------------------------- 1 | use cfg_if::cfg_if; 2 | 3 | cfg_if! { 4 | // When the `console_error_panic_hook` feature is enabled, we can call the 5 | // `set_panic_hook` function to get better error messages if we ever panic. 6 | if #[cfg(feature = "console_error_panic_hook")] { 7 | use console_error_panic_hook::set_once as set_panic_hook; 8 | } else { 9 | #[inline] 10 | fn set_panic_hook() {} 11 | } 12 | } 13 | 14 | cfg_if! { 15 | // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global allocator. 16 | if #[cfg(feature = "wee_alloc")] { 17 | #[global_allocator] 18 | static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; 19 | } 20 | } 21 | 22 | pub fn init() { 23 | set_panic_hook(); 24 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/rust/web: -------------------------------------------------------------------------------- 1 | use wasm_bindgen_test::{wasm_bindgen_test_configure, wasm_bindgen_test}; 2 | use futures::prelude::*; 3 | use wasm_bindgen::JsValue; 4 | use wasm_bindgen_futures::JsFuture; 5 | 6 | wasm_bindgen_test_configure!(run_in_browser); 7 | 8 | #[wasm_bindgen_test] 9 | fn web_test() { 10 | assert_eq!(1, 1); 11 | } 12 | 13 | #[wasm_bindgen_test(async)] 14 | fn async_test() -> impl Future { 15 | // Creates a JavaScript Promise which will asynchronously resolve with the value 42. 16 | let promise = js_sys::Promise::resolve(&JsValue::from(42)); 17 | 18 | // Converts that Promise into a Future. 19 | // The unit test will wait for the Future to resolve. 20 | JsFuture::from(promise) 21 | .map(|x| { 22 | assert_eq!(x, 42); 23 | }) 24 | } -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/app: -------------------------------------------------------------------------------- 1 | /** 2 | * Application Core 3 | * @version 1.0.0 4 | */ 5 | import * as Backbone from 'backbone'; 6 | import {Application, View} from 'backbone.marionette'; 7 | import AppRouter from 'marionette.approuter'; 8 | import {html} from 'lit-html'; 9 | import * as logging from '../plugins/mn.radio.logging'; 10 | import state from '../plugins/mn.redux.state'; 11 | import '../shims/mn.renderer.shim'; 12 | import header from './header'; 13 | import body from './body'; 14 | import footer from './footer'; 15 | 16 | const Router = AppRouter.extend({ 17 | appRoutes: { 18 | hello: 'sayHello' 19 | } 20 | }); 21 | const App = Application.extend({ 22 | region: { 23 | el: 'body', 24 | replaceElement: true 25 | }, 26 | onBeforeStart(app, options) { 27 | const {name} = options; 28 | const controller = { 29 | sayHello: function() { 30 | app.info('hello'); 31 | } 32 | }; 33 | app.info(``${name} is starting...``); 34 | app.router = new Router({controller}); 35 | Backbone.history.start(); 36 | }, 37 | onStart(app, options) { 38 | const {name} = options; 39 | const Model = Backbone.Model.extend({ 40 | defaults: {name} 41 | }); 42 | const MainView = View.extend({ 43 | tagName: 'body', 44 | template: ({name}) => html`` 45 | ${header({name})} 46 | ${body} 47 | ${footer({name})} 48 | ``, 49 | model: new Model() 50 | }); 51 | app.getRegion().show(new MainView()); 52 | app.info(``${name} is started!``); 53 | } 54 | }); 55 | 56 | export default Object.assign(new App(), logging, state); -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/body: -------------------------------------------------------------------------------- 1 | import {html} from 'lit-html'; 2 | 3 | export default html`` 4 |
5 | 6 |

What happens next is up to you...

7 |
8 | ``; -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/footer: -------------------------------------------------------------------------------- 1 | import {html} from 'lit-html'; 2 | 3 | const links = { 4 | prelude: 'https://github.com/jhwohlgemuth/pwsh-prelude', 5 | ninalimpi: 'https://twitter.com/ninalimpi', 6 | undraw: 'https://undraw.co/' 7 | }; 8 | 9 | export default ({name}) => html`` 10 | 14 | ``; -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/header: -------------------------------------------------------------------------------- 1 | import {html} from 'lit-html'; 2 | 3 | export default ({name}) => html`` 4 |
5 |

${name}

6 |
7 | ``; -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/main: -------------------------------------------------------------------------------- 1 | /** 2 | * Main entry point for application 3 | */ 4 | import app from './components/app'; 5 | 6 | const options = { 7 | name: 'My Web Application' 8 | }; 9 | document.addEventListener('DOMContentLoaded', () => app.start(options)); 10 | -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/mn.redux.state: -------------------------------------------------------------------------------- 1 | /** 2 | * Add Redux store to application 3 | * @description Features: 4 | * - Enhanced getState that accepts path parameter 5 | * - "dispatch logging" middleware 6 | * - Basic reducer showcasing how to leverage lodash for updating state 7 | * @example Extend application object 8 | * import {Application} from 'backbone.marionette'; 9 | * import state from './plugins/redux.state'; 10 | * const app = new Application(); 11 | * export default Object.assign(app, state); 12 | * @example Enhanced getState accepts path parameter 13 | * app.getState();// {count: 42} 14 | * app.getState('count');// 42 15 | * @example Update state with Redux API 16 | * app.getState('count');// 42 17 | * app.dispatch({type: 'INCREMENT'}); 18 | * app.getState('count');// 43 19 | */ 20 | import {get, update} from 'lodash-es'; 21 | import {applyMiddleware, compose, createStore} from 'redux'; 22 | 23 | const initialState = { 24 | count: 42 25 | }; 26 | 27 | export default createStore( 28 | reducer, 29 | initialState, 30 | compose( 31 | applyMiddleware(dispatchLogger), 32 | addGetStatePathParameter() 33 | ) 34 | ); 35 | // state reducer 36 | function reducer(state, action) { 37 | switch (action.type) { 38 | case 'INCREMENT': 39 | return update(state, 'count', increment); 40 | case 'DECREMENT': 41 | return update(state, 'count', decrement); 42 | default: 43 | return state; 44 | } 45 | } 46 | // middleware 47 | function dispatchLogger() { 48 | return next => action => 49 | // console.log(``Dispatch: ${action.type}``); 50 | next(action) 51 | ; 52 | } 53 | // store enhancer 54 | function addGetStatePathParameter() { 55 | return createStore => (reducer, preloadedState, enhancer) => { 56 | const store = createStore(reducer, preloadedState, enhancer); 57 | const getState = path => (typeof (path) === 'string') ? get(store.getState(), path) : store.getState(); 58 | const {dispatch, subscribe} = store; 59 | return {getState, dispatch, subscribe}; 60 | }; 61 | } 62 | // pure functions 63 | function increment(val) { 64 | return val + 1; 65 | } 66 | function decrement(val) { 67 | return val - 1; 68 | } 69 | -------------------------------------------------------------------------------- /Prelude/src/templates/source/vanilla/mn.renderer.shim: -------------------------------------------------------------------------------- 1 | /** 2 | * Shim Marionette template renderer to use lit-html 3 | * @see https://github.com/polymer/lit-html 4 | * @see https://lit-html.polymer-project.org/guide/tools#development 5 | * @example It is also possible to use libraries such as morphdom 6 | * import * as Marionette from 'backbone.marionette'; 7 | * import {template} from 'lodash-es'; 8 | * import morphdom from 'morphdom'; 9 | * 10 | * Marionette.View.setRenderer(function(html, data) { 11 | * const {el} = this; 12 | * const node = el.cloneNode(false);// shallow clone 13 | * node.innerHTML = template(html)(data); 14 | * morphdom(el, node); 15 | * }); 16 | */ 17 | import * as Marionette from 'backbone.marionette'; 18 | import {render} from 'lit-html'; 19 | 20 | Marionette.View.setRenderer(function(template, data) { 21 | const {el} = this; 22 | render(typeof template === 'function' ? template(data) : template, el); 23 | }); 24 | -------------------------------------------------------------------------------- /Prelude/types/FileInfo.Types.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.IO.FileInfo 5 | 6 | 7 | SHA512 8 | 11 | 12 | 13 | SHA256 14 | 17 | 18 | 19 | SHA1 20 | 23 | 24 | 25 | MD5 26 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Prelude/types/Hashtable.Types.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.Collections.Hashtable 5 | 6 | 7 | Invert 8 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Prelude/types/Int.Types.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.Int16 5 | 6 | 7 | Factorial 8 | 11 | 12 | 13 | Permutations 14 | 17 | 18 | 19 | ToMoney 20 | 23 | 24 | 25 | 26 | 27 | System.Int32 28 | 29 | 30 | Factorial 31 | 34 | 35 | 36 | Permutations 37 | 40 | 41 | 42 | ToMoney 43 | 46 | 47 | 48 | 49 | 50 | System.Int64 51 | 52 | 53 | Factorial 54 | 57 | 58 | 59 | Permutations 60 | 63 | 64 | 65 | ToMoney 66 | 69 | 70 | 71 | 72 | 73 | System.Double 74 | 75 | 76 | Factorial 77 | 80 | 81 | 82 | Permutations 83 | 86 | 87 | 88 | ToMoney 89 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Prelude/types/Matrix.Types.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Prelude.Matrix 5 | 6 | 7 | Add 8 | 11 | 12 | 13 | Adj 14 | 17 | 18 | 19 | Columns 20 | 23 | 24 | 25 | Det 26 | 33 | 34 | 35 | Dot 36 | 39 | 40 | 41 | Inverse 42 | 45 | 46 | 47 | Multiply 48 | 51 | 52 | 53 | Trace 54 | 57 | 58 | 59 | Transpose 60 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Prelude/types/String.Types.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.String 5 | 6 | 7 | Permutations 8 | 11 | 12 | 13 | FromBase64 14 | 17 | 18 | 19 | ToBase64 20 | 23 | 24 | 25 | ToMoney 26 | 29 | 30 | 31 | 32 | 33 | System.Security.SecureString 34 | 35 | 36 | ToPlainText 37 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | image: 4 | - Visual Studio 2019 5 | - Ubuntu 6 | 7 | platform: 8 | - Any CPU 9 | 10 | matrix: 11 | fast_finish: true 12 | 13 | install: 14 | - ps: ./Invoke-Setup.ps1 15 | - ps: dotnet tool install --global Codecov.Tool 16 | 17 | build_script: 18 | - ps: ./Invoke-Task.ps1 -Lint -CI 19 | - ps: ./Invoke-Task.ps1 -Lint -Plus -CI 20 | 21 | for: 22 | - 23 | matrix: 24 | only: 25 | - image: Ubuntu 26 | 27 | test_script: 28 | - ps: ./Invoke-Task.ps1 -Test -Tags 'Remote' -Platform 'linux' -WithCoverage 29 | 30 | test_script: 31 | - ps: ./Invoke-Task.ps1 -Test -Tags 'Remote' -Platform 'windows' -WithCoverage 32 | 33 | after_test: 34 | - ps: codecov -f "**/coverage.xml" -t $Env:CODECOV_TOKEN -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | require_ci_to_pass: true 3 | ci: 4 | - appveyor 5 | 6 | coverage: 7 | precision: 2 8 | round: down 9 | range: "70...100" 10 | 11 | parsers: 12 | gcov: 13 | branch_detection: 14 | conditional: yes 15 | loop: yes 16 | method: no 17 | macro: no 18 | 19 | comment: 20 | layout: "reach,diff,flags,files,footer" 21 | behavior: default 22 | require_changes: false 23 | branches: 24 | - "master" 25 | -------------------------------------------------------------------------------- /csharp/CommandLineInterface/CommandLineInterface.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2023 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | namespace Prelude { 7 | using Spectre.Console; 8 | using System.Collections.Generic; 9 | 10 | public class CommandLineInterface { 11 | #nullable enable 12 | public CommandLineInterface() { } 13 | public const int COLOR_BLUE = 12; 14 | public const string DEFAULT_MORE_CHOICES_TEXT = "[grey](Move up and down to reveal more items)[/]"; 15 | public static Style PreludeStyle(Color? foreground = null, Color? background = null, Decoration? decoration = null, string link = "") { 16 | return new Style(foreground, background, decoration, link); 17 | } 18 | public static List Menu(string[] values, int limit = 10, Style? style = null, string instructions = "[grey](Press [blue][/] to toggle, [green][/] to accept)[/]") { 19 | var moreChoicesText = values.Length > limit ? DEFAULT_MORE_CHOICES_TEXT : ""; 20 | var items = AnsiConsole.Prompt( 21 | new MultiSelectionPrompt() 22 | .NotRequired() 23 | .PageSize(limit) 24 | .HighlightStyle(style != null ? style : PreludeStyle(COLOR_BLUE)) 25 | .MoreChoicesText(moreChoicesText) 26 | .InstructionsText(instructions) 27 | .AddChoices(values)); 28 | return items; 29 | } 30 | public static string Select(string[] values, int limit = 10, Style? style = null) { 31 | var moreChoicesText = values.Length > limit ? DEFAULT_MORE_CHOICES_TEXT : ""; 32 | var item = AnsiConsole.Prompt( 33 | new SelectionPrompt() 34 | .PageSize(limit) 35 | .HighlightStyle(style != null ? style : PreludeStyle(COLOR_BLUE)) 36 | .MoreChoicesText(moreChoicesText) 37 | .AddChoices(values)); 38 | return item; 39 | } 40 | public static string Unwrap(string value) { 41 | return Markup.Remove(value); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /csharp/CommandLineInterface/CommandLineInterface.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ..\..\..\..\.nuget\packages\system.runtime\4.3.1\lib\net462\System.Runtime.dll 20 | 21 | 22 | ..\..\..\..\.nuget\packages\spectre.console\0.47.0\lib\net6.0\Spectre.Console.dll 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /csharp/Geodetic/Datum.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | namespace Prelude.Geodetic { 7 | /// 8 | /// Container class for World Geodetic System 1984 (WGS84) paramters. 9 | /// 10 | public static class Datum { 11 | /// 12 | /// Semi major axis of the WGS84 ellipsoid, a (in meters). 13 | /// 14 | public const double SemiMajorAxis = 6378137.0; 15 | 16 | /// 17 | /// Semi minor axis of the WGS84 ellipsoid, b (in meters). 18 | /// 19 | public const double SemiMinorAxis = 6356752.31424518; 20 | 21 | /// 22 | /// Flattening factor of the WGS84 ellipsoid, 1/f. 23 | /// 24 | public const double FlatteningFactor = 298.257223563; 25 | 26 | /// 27 | /// Linear eccentricity of the WGS84 ellipsoid, E (in meters). 28 | /// 29 | public const double LinearEccentricity = 521854.00842339; 30 | 31 | /// 32 | /// Eccentricity of WGS84 ellipsoid, e. 33 | /// 34 | public const double Eccentricity = 0.0818191908426215; 35 | 36 | /// 37 | /// Eccentricity squared, e^2. 38 | /// 39 | public const double EccentricitySquared = 0.006694379990141; 40 | 41 | /// 42 | /// Earth mean radius (in meters). 43 | /// 44 | public const double Radius = 6371001; 45 | 46 | /// 47 | /// Earth constant surface area radius (in meters). 48 | /// 49 | public const double RadiusAuthalic = 6371007.1810; 50 | } 51 | } -------------------------------------------------------------------------------- /csharp/Geodetic/Geodetic.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /csharp/Geodetic/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1500:Braces for multi-line statements should not share line", Justification = "1TBS is my favorite")] 9 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Adding a this for local calls is unnecessary")] 10 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "I just like the simplicity of being able to omit the braces")] -------------------------------------------------------------------------------- /csharp/Geodetic/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "companyName": "Jason Wohlgemuth", 6 | "copyrightText": "Copyright (c) 2022 {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information.", 7 | "variables": { 8 | "licenseName": "MIT", 9 | "licenseFile": "LICENSE" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /csharp/Graph/DirectedEdge.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | namespace Prelude { 7 | using System; 8 | 9 | /// 10 | /// Directed edge for use within a . 11 | /// 12 | public class DirectedEdge : Edge { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// Direction of edge is from the node. 17 | /// Direction of edge is to the node. 18 | /// Weight of the edge. 19 | public DirectedEdge(Node source, Node target, double weight = 1) : base(source, target, weight) { 20 | Id = Guid.NewGuid(); 21 | Source = source; 22 | Target = target; 23 | Weight = weight; 24 | } 25 | 26 | /// 27 | /// Gets a value indicating whether the edge is directed. 28 | /// 29 | /// 30 | /// Essentially the only difference between the DirectedEdge and Edge classes. 31 | /// 32 | public override bool IsDirected { 33 | get { 34 | return true; 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /csharp/Graph/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1500:Braces for multi-line statements should not share line", Justification = "1TBS is my favorite")] 9 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Adding a this for local calls is unnecessary")] 10 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1128:Put constructor initializers on their own line", Justification = "I don't like having to do this")] 11 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "I just like the simplicity of being able to omit the braces")] 12 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1519:Braces should not be omitted from multi-line child statement", Justification = "I just like the simplicity of being able to omit the braces")] 13 | [assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "I kind of prefer a space after the new keyword, but I cannot figure out how to disable the rule")] -------------------------------------------------------------------------------- /csharp/Graph/Graph.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /csharp/Graph/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "companyName": "Jason Wohlgemuth", 6 | "copyrightText": "Copyright (c) 2022 {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information.", 7 | "variables": { 8 | "licenseName": "MIT", 9 | "licenseFile": "LICENSE" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /csharp/Matrix/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1500:Braces for multi-line statements should not share line", Justification = "1TBS is my favorite")] 9 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Adding a this for local calls is unnecessary")] 10 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1128:Put constructor initializers on their own line", Justification = "I don't like having to do this")] 11 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "I just like the simplicity of being able to omit the braces")] 12 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1519:Braces should not be omitted from multi-line child statement", Justification = "I just like the simplicity of being able to omit the braces")] 13 | [assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "I kind of prefer a space after the new keyword, but I cannot figure out how to disable the rule")] -------------------------------------------------------------------------------- /csharp/Matrix/Matrix.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /csharp/Matrix/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "companyName": "Jason Wohlgemuth", 6 | "copyrightText": "Copyright (c) 2022 {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information.", 7 | "variables": { 8 | "licenseName": "MIT", 9 | "licenseFile": "LICENSE" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /csharp/Performance/Performance.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /csharp/Performance/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BenchmarkDotNet.Attributes; 3 | using BenchmarkDotNet.Running; 4 | using Prelude; 5 | 6 | namespace Performance { 7 | public class Program { 8 | private Matrix A; 9 | 10 | [GlobalSetup] 11 | public void Setup() { 12 | A = new Matrix(10); 13 | double[,] rows = new double[,] { 14 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, 15 | { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }, 16 | { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, 17 | { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 }, 18 | { 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 }, 19 | { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 }, 20 | { 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 }, 21 | { 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 }, 22 | { 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 }, 23 | { 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 } 24 | }; 25 | foreach (var Index in A.Indexes()) { 26 | int i = Index[0], j = Index[1]; 27 | A.Rows[i][j] = rows[i, j]; 28 | } 29 | } 30 | [Benchmark] 31 | public void Matrix_Transpose() => Matrix.Transpose(A); 32 | [Benchmark] 33 | public void Matrix_Determinant() => Matrix.Det(A); 34 | static void Main(string[] args) { 35 | var results = BenchmarkRunner.Run(); 36 | Console.WriteLine(results); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /csharp/Tests/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1500:Braces for multi-line statements should not share line", Justification = "1TBS is my favorite")] 9 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Adding a this for local calls is unnecessary")] 10 | [assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "I just like the simplicity of being able to omit the braces")] 11 | [assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "Test classes do not need documentation")] 12 | [assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "I like to name the unit test class UnitTests")] 13 | [assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "I kind of prefer a space after the new keyword, but I cannot figure out how to disable the rule")] 14 | [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1118:Parameter should not span multiple lines", Justification = "Useful for making matrix values more readable", Scope = "type", Target = "~T:MatrixTests.UnitTests")] -------------------------------------------------------------------------------- /csharp/Tests/Item.Tests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | namespace ItemTests { 7 | using Prelude; 8 | using Xunit; 9 | 10 | public class UnitTests { 11 | [Fact] 12 | public void Can_be_created_from_a_double() { 13 | var defaultValue = 0; 14 | var value = 42; 15 | var x = new Item(); 16 | var y = new Item(value); 17 | Assert.Equal(defaultValue, x.Value); 18 | Assert.Equal(value, y.Value); 19 | } 20 | 21 | [Fact] 22 | public void Can_be_created_from_a_node_and_value() { 23 | var defaultValue = 0; 24 | var value = 42; 25 | var a = new Node("a"); 26 | var x = new Item(a); 27 | var y = new Item(a, value); 28 | Assert.Equal(defaultValue, x.Value); 29 | Assert.Equal(a, x.Node); 30 | Assert.Equal(value, y.Value); 31 | Assert.Equal(a, y.Node); 32 | } 33 | 34 | [Fact] 35 | public void Can_be_compared_in_various_contexts() { 36 | var a = new Item(42); 37 | var b = new Item(43); 38 | Assert.True(a.Equals(a)); 39 | Assert.False(a.Equals(b)); 40 | Assert.False(a.Equals(null)); 41 | Assert.True(Equals(a, a)); 42 | Assert.False(Equals(a, b)); 43 | Assert.False(Equals(null, a)); 44 | Assert.False(Equals(a, null)); 45 | Assert.True(Equals(null, null)); 46 | #pragma warning disable CS1718 // Comparison made to same variable 47 | Assert.True(a == a); 48 | Assert.False(a != a); 49 | Assert.True(a <= a); 50 | Assert.True(a >= a); 51 | #pragma warning restore CS1718 // Comparison made to same variable 52 | Assert.False(a == b); 53 | Assert.True(a != b); 54 | Assert.True(a != null); 55 | #pragma warning disable SA1131 // Use readable conditions 56 | Assert.True(null != a); 57 | #pragma warning restore SA1131 // Use readable conditions 58 | Assert.Equal(a.GetHashCode(), a.GetHashCode()); 59 | Assert.True(a < b); 60 | Assert.True(a <= b); 61 | Assert.False(a > b); 62 | Assert.False(a >= b); 63 | Assert.True(b > a); 64 | Assert.True(b >= a); 65 | Assert.False(b < a); 66 | Assert.False(b <= a); 67 | Assert.False(a < null); 68 | Assert.False(a <= null); 69 | Assert.False(a > null); 70 | Assert.False(a >= null); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /csharp/Tests/PriorityQueue.Tests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Jason Wohlgemuth. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | // 5 | 6 | namespace PriorityQueueTests { 7 | using Prelude; 8 | using Xunit; 9 | 10 | public class UnitTests { 11 | [Fact] 12 | public void Can_be_created_with_no_arguments() { 13 | var q = new PriorityQueue(); 14 | Assert.Equal(0, q.CurrentSize); 15 | Assert.True(q.IsEmpty()); 16 | } 17 | 18 | [Fact] 19 | public void Can_add_items() { 20 | var q = new PriorityQueue(); 21 | Node u = new("u"); 22 | Node v = new("v"); 23 | q.Insert(1, u); 24 | Assert.Equal(1, q.CurrentSize); 25 | q.Insert(2, v); 26 | Assert.Equal(2, q.CurrentSize); 27 | } 28 | 29 | [Fact] 30 | public void Can_swap_items() { 31 | var q = new PriorityQueue(); 32 | Node a = new("a"); 33 | Node b = new("b"); 34 | Node c = new("c"); 35 | q.Insert(1, a); 36 | q.Insert(2, b); 37 | q.Insert(3, c); 38 | Assert.Equal(a, q.Items[0].Node); 39 | Assert.Equal(b, q.Items[1].Node); 40 | Assert.Equal(c, q.Items[2].Node); 41 | q.Swap(0, 2); 42 | Assert.Equal(c, q.Items[0].Node); 43 | Assert.Equal(b, q.Items[1].Node); 44 | Assert.Equal(a, q.Items[2].Node); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /csharp/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | all 20 | runtime; build; native; contentfiles; analyzers; buildtransitive 21 | 22 | 23 | 24 | 25 | all 26 | runtime; build; native; contentfiles; analyzers; buildtransitive 27 | 28 | 29 | 30 | runtime; build; native; contentfiles; analyzers; buildtransitive 31 | all 32 | 33 | 34 | runtime; build; native; contentfiles; analyzers; buildtransitive 35 | all 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /csharp/Tests/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "documentationRules": { 5 | "companyName": "Jason Wohlgemuth", 6 | "copyrightText": "Copyright (c) 2022 {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information.", 7 | "variables": { 8 | "licenseName": "MIT", 9 | "licenseFile": "LICENSE" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /csharp/testEnvironments.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "environments": [ 4 | { 5 | "name": "WSL (Ubuntu)", 6 | "type": "wsl", 7 | "wslDistribution": "Ubuntu" 8 | }, 9 | { 10 | "name": "SSH (VEDA)", 11 | "type": "ssh", 12 | "remoteUri": "ssh://jason@veda:22" 13 | }, 14 | { 15 | "name": "Docker (jhwohlgemuth/env)", 16 | "type": "docker", 17 | "dockerImage": "jhwohlgemuth/env:latest" 18 | }, 19 | { 20 | "name": "Docker (jhwohlgemuth/notebook)", 21 | "type": "docker", 22 | "dockerImage": "jhwohlgemuth/notebook:latest" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /kitchensink.ps1: -------------------------------------------------------------------------------- 1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('RequireDirective', '')] 2 | Param() 3 | Remove-Module -Name Prelude 4 | Import-Module './Prelude' 5 | 6 | $Space = ' ' 7 | $Indent = 4 8 | $LabelParameters = @{ 9 | Indent = $Indent 10 | NewLine = $True 11 | } 12 | $ResultLabelParameters = @{ 13 | Color = 'Green' 14 | Indent = $Indent 15 | NewLine = $True 16 | } 17 | 18 | Write-Title ' Kitchen Sink ' -SubText '#allthethings' -Yellow 19 | 20 | $Space 21 | 22 | $Fullname = Invoke-Input 'Full Name?' -Indent $Indent 23 | $Username = Invoke-Input 'Username?' -MaxLength 10 -Indent $Indent 24 | $Age = Invoke-Input 'Age?' -Number -Indent $Indent 25 | $Pass = Invoke-Input 'Password?' -Secret -Indent $Indent 26 | $FavoriteSaiyajin = Invoke-Input 'Favorite Saiya-jin?' -Autocomplete -Indent $Indent -Choices ` 27 | @( 28 | 'Goku' 29 | 'Gohan' 30 | 'Goten' 31 | 'Vegeta' 32 | 'Trunks' 33 | ) 34 | 35 | 'Favorite number?' | Write-Label @LabelParameters 36 | $FavoriteNumberWord = 'one', 'two', 'three' | Invoke-Menu -SingleSelect -Indent $Indent 37 | 38 | 'Known mathematicians?' | Write-Label @LabelParameters 39 | $Choice = 'Godel', 'Gauss', 'Cantor' | Invoke-Menu -MultiSelect -Indent $Indent 40 | 41 | '{{#red Red}}, {{#white White}}, or {{#blue Blue}}?' | Write-Label @LabelParameters 42 | $FavoriteColor = '{{#red red}}', 'white', '{{#blue blue}}' | Invoke-Menu -Indent $Indent -Unwrap 43 | 44 | $Space 45 | 46 | 'Favorite number between 1 and 100?' | Write-Label -Indent $Indent 47 | $Space 48 | $FavoriteNumber = 1..100 | Invoke-Menu -Limit 10 -Indent $Indent 49 | 50 | $Space 51 | 52 | 'Favorite index between 0 and 9?' | Write-Label -Indent $Indent 53 | $Space 54 | $FavoriteIndex = 1..10 | Invoke-Menu -Limit 3 -Indent $Indent -ReturnIndex 55 | 56 | $Space 57 | 58 | 'Results' | Write-Title -Magenta -TextColor White 59 | $Fullname | Write-Label @ResultLabelParameters 60 | $Username | Write-Label @ResultLabelParameters 61 | $Age | Write-Label @ResultLabelParameters 62 | $Pass | Write-Label @ResultLabelParameters 63 | $FavoriteSaiyajin | Write-Label @ResultLabelParameters 64 | $FavoriteNumberWord | Write-Label @ResultLabelParameters 65 | (Join-StringsWithGrammar $Choice) | Write-Label @ResultLabelParameters 66 | $FavoriteColor | Write-Label @ResultLabelParameters 67 | $FavoriteNumber | Write-Label @ResultLabelParameters 68 | $FavoriteIndex | Write-Label @ResultLabelParameters 69 | 70 | $Space 71 | 72 | 'Show bar charts?' | Write-Label -NewLine 73 | $Choice = 'no', 'yes' | Invoke-Menu 74 | if ($Choice -eq 'yes') { 75 | 'Bar Charts' | Write-Title -Blue 76 | Get-ChildItem -File | Invoke-Reduce -FileInfo | Write-BarChart 77 | Get-ChildItem -File | Invoke-Reduce -FileInfo | Write-BarChart -Alternate 78 | Get-ChildItem -File | Invoke-Reduce -FileInfo | Write-BarChart -ShowValues 79 | Get-ChildItem -File | Invoke-Reduce -FileInfo | Write-BarChart -ShowValues -Alternate 80 | Get-ChildItem -File | Invoke-Reduce -FileInfo | Write-BarChart -ShowValues -WithColor 81 | Get-ChildItem -File | Invoke-Reduce -FileInfo | Write-BarChart -ShowValues -WithColor -Alternate 82 | } 83 | -------------------------------------------------------------------------------- /stryker-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "stryker-config": { 3 | "test-projects": [ 4 | "./csharp/Tests/Tests.csproj" 5 | ], 6 | "reporters": [ 7 | "html", 8 | "progress" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /styles/Microsoft/AMPM.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: Use 'AM' or 'PM' (preceded by a space). 3 | link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2}[AP]M' 8 | - '\d{1,2} ?[ap]m' 9 | - '\d{1,2} ?[aApP]\.[mM]\.' 10 | -------------------------------------------------------------------------------- /styles/Microsoft/Accessibility.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't use language (such as '%s') that defines people by their disability." 3 | link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms 4 | level: suggestion 5 | ignorecase: true 6 | tokens: 7 | - a victim of 8 | - able-bodied 9 | - affected by 10 | - an epileptic 11 | - crippled 12 | - disabled 13 | - dumb 14 | - handicapped 15 | - handicaps 16 | - healthy 17 | - lame 18 | - maimed 19 | - missing a limb 20 | - mute 21 | - normal 22 | - sight-impaired 23 | - stricken with 24 | - suffers from 25 | - vision-impaired 26 | -------------------------------------------------------------------------------- /styles/Microsoft/Acronyms.yml: -------------------------------------------------------------------------------- 1 | extends: conditional 2 | message: "'%s' has no definition." 3 | link: https://docs.microsoft.com/en-us/style-guide/acronyms 4 | level: suggestion 5 | ignorecase: false 6 | # Ensures that the existence of 'first' implies the existence of 'second'. 7 | first: '\b([A-Z]{3,5})\b' 8 | second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)' 9 | # ... with the exception of these: 10 | exceptions: 11 | - API 12 | - ASP 13 | - CLI 14 | - CPU 15 | - CSS 16 | - CSV 17 | - DEBUG 18 | - DOM 19 | - DPI 20 | - FAQ 21 | - GCC 22 | - GDB 23 | - GET 24 | - GPU 25 | - GTK 26 | - GUI 27 | - HTML 28 | - HTTP 29 | - HTTPS 30 | - IDE 31 | - JAR 32 | - JSON 33 | - JSX 34 | - LESS 35 | - LLDB 36 | - NET 37 | - NOTE 38 | - NVDA 39 | - OSS 40 | - PATH 41 | - PDF 42 | - PHP 43 | - POST 44 | - RAM 45 | - REPL 46 | - RSA 47 | - SCM 48 | - SCSS 49 | - SDK 50 | - SQL 51 | - SSH 52 | - SSL 53 | - SVG 54 | - TBD 55 | - TCP 56 | - TODO 57 | - URI 58 | - URL 59 | - USB 60 | - UTF 61 | - XML 62 | - XSS 63 | - YAML 64 | - ZIP 65 | -------------------------------------------------------------------------------- /styles/Microsoft/Auto.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "In general, don't hyphenate '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/a/auto 4 | ignorecase: true 5 | level: error 6 | action: 7 | name: convert 8 | params: 9 | - simple 10 | tokens: 11 | - 'auto-\w+' 12 | -------------------------------------------------------------------------------- /styles/Microsoft/Avoid.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't use '%s'. See the A-Z word list for details." 3 | # See the A-Z word list 4 | link: https://docs.microsoft.com/en-us/style-guide 5 | ignorecase: true 6 | level: error 7 | tokens: 8 | - abortion 9 | - and so on 10 | - app(?:lication)?s? (?:developer|program) 11 | - app(?:lication)? file 12 | - backbone 13 | - backend 14 | - contiguous selection 15 | -------------------------------------------------------------------------------- /styles/Microsoft/Contractions.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Use '%s' instead of '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-contractions 4 | level: error 5 | ignorecase: true 6 | action: 7 | name: replace 8 | swap: 9 | are not: aren't 10 | cannot: can't 11 | could not: couldn't 12 | did not: didn't 13 | do not: don't 14 | does not: doesn't 15 | has not: hasn't 16 | have not: haven't 17 | how is: how's 18 | is not: isn't 19 | 20 | 'it is(?!\.)': it's 21 | 'it''s(?=\.)': it is 22 | 23 | should not: shouldn't 24 | 25 | 'that is(?!\.)': that's 26 | 'that''s(?=\.)': that is 27 | 28 | 'they are(?!\.)': they're 29 | 'they''re(?=\.)': they are 30 | 31 | was not: wasn't 32 | 33 | 'we are(?!\.)': we're 34 | 'we''re(?=\.)': we are 35 | 36 | 'we have(?!\.)': we've 37 | 'we''ve(?=\.)': we have 38 | 39 | were not: weren't 40 | 41 | 'what is(?!\.)': what's 42 | 'what''s(?=\.)': what is 43 | 44 | 'when is(?!\.)': when's 45 | 'when''s(?=\.)': when is 46 | 47 | 'where is(?!\.)': where's 48 | 'where''s(?=\.)': where is 49 | 50 | will not: won't 51 | -------------------------------------------------------------------------------- /styles/Microsoft/Dashes.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Remove the spaces around '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/emes 4 | ignorecase: true 5 | nonword: true 6 | level: error 7 | action: 8 | name: edit 9 | params: 10 | - remove 11 | - ' ' 12 | tokens: 13 | - '[—–]\s|\s[—–]' 14 | -------------------------------------------------------------------------------- /styles/Microsoft/DateFormat.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: Use 'July 31, 2016' format, not '%s'. 3 | link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms 4 | ignorecase: true 5 | level: error 6 | nonword: true 7 | tokens: 8 | - '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}' 9 | -------------------------------------------------------------------------------- /styles/Microsoft/DateNumbers.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't use ordinal numbers for dates." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates 4 | level: error 5 | nonword: true 6 | ignorecase: true 7 | raw: 8 | - \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?)\b\s* 9 | tokens: 10 | - first 11 | - second 12 | - third 13 | - fourth 14 | - fifth 15 | - sixth 16 | - seventh 17 | - eighth 18 | - ninth 19 | - tenth 20 | - eleventh 21 | - twelfth 22 | - thirteenth 23 | - fourteenth 24 | - fifteenth 25 | - sixteenth 26 | - seventeenth 27 | - eighteenth 28 | - nineteenth 29 | - twentieth 30 | - twenty-first 31 | - twenty-second 32 | - twenty-third 33 | - twenty-fourth 34 | - twenty-fifth 35 | - twenty-sixth 36 | - twenty-seventh 37 | - twenty-eighth 38 | - twenty-ninth 39 | - thirtieth 40 | - thirty-first 41 | -------------------------------------------------------------------------------- /styles/Microsoft/DateOrder.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Always spell out the name of the month." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates 4 | ignorecase: true 5 | level: error 6 | nonword: true 7 | tokens: 8 | - '\b\d{1,2}/\d{1,2}/(?:\d{4}|\d{2})\b' 9 | -------------------------------------------------------------------------------- /styles/Microsoft/Ellipses.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "In general, don't use an ellipsis." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/ellipses 4 | nonword: true 5 | level: warning 6 | action: 7 | name: remove 8 | tokens: 9 | - '\.\.\.' 10 | -------------------------------------------------------------------------------- /styles/Microsoft/FirstPerson.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use first person (such as '%s') sparingly." 3 | link: https://docs.microsoft.com/en-us/style-guide/grammar/person 4 | ignorecase: true 5 | level: warning 6 | nonword: true 7 | tokens: 8 | - (?:^|\s)I\s 9 | - (?:^|\s)I,\s 10 | - \bI'd\b 11 | - \bI'll\b 12 | - \bI'm\b 13 | - \bI've\b 14 | - \bme\b 15 | - \bmy\b 16 | - \bmine\b 17 | -------------------------------------------------------------------------------- /styles/Microsoft/Foreign.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Use '%s' instead of '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words 4 | ignorecase: true 5 | level: error 6 | nonword: true 7 | action: 8 | name: replace 9 | swap: 10 | '\b(?:eg|e\.g\.)[\s,]': for example 11 | '\b(?:ie|i\.e\.)[\s,]': that is 12 | 13 | -------------------------------------------------------------------------------- /styles/Microsoft/Gender.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't use '%s'." 3 | link: https://github.com/MicrosoftDocs/microsoft-style-guide/blob/master/styleguide/grammar/nouns-pronouns.md#pronouns-and-gender 4 | level: error 5 | ignorecase: true 6 | tokens: 7 | - he/she 8 | - s/he 9 | -------------------------------------------------------------------------------- /styles/Microsoft/GenderBias.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Consider using '%s' instead of '%s'." 3 | ignorecase: true 4 | level: error 5 | swap: 6 | (?:alumna|alumnus): graduate 7 | (?:alumnae|alumni): graduates 8 | air(?:m[ae]n|wom[ae]n): pilot(s) 9 | anchor(?:m[ae]n|wom[ae]n): anchor(s) 10 | authoress: author 11 | camera(?:m[ae]n|wom[ae]n): camera operator(s) 12 | chair(?:m[ae]n|wom[ae]n): chair(s) 13 | congress(?:m[ae]n|wom[ae]n): member(s) of congress 14 | door(?:m[ae]|wom[ae]n): concierge(s) 15 | draft(?:m[ae]n|wom[ae]n): drafter(s) 16 | fire(?:m[ae]n|wom[ae]n): firefighter(s) 17 | fisher(?:m[ae]n|wom[ae]n): fisher(s) 18 | fresh(?:m[ae]n|wom[ae]n): first-year student(s) 19 | garbage(?:m[ae]n|wom[ae]n): waste collector(s) 20 | lady lawyer: lawyer 21 | ladylike: courteous 22 | landlord: building manager 23 | mail(?:m[ae]n|wom[ae]n): mail carriers 24 | man and wife: husband and wife 25 | man enough: strong enough 26 | mankind: human kind 27 | manmade: manufactured 28 | manpower: personnel 29 | men and girls: men and women 30 | middle(?:m[ae]n|wom[ae]n): intermediary 31 | news(?:m[ae]n|wom[ae]n): journalist(s) 32 | ombuds(?:man|woman): ombuds 33 | oneupmanship: upstaging 34 | poetess: poet 35 | police(?:m[ae]n|wom[ae]n): police officer(s) 36 | repair(?:m[ae]n|wom[ae]n): technician(s) 37 | sales(?:m[ae]n|wom[ae]n): salesperson or sales people 38 | service(?:m[ae]n|wom[ae]n): soldier(s) 39 | steward(?:ess)?: flight attendant 40 | tribes(?:m[ae]n|wom[ae]n): tribe member(s) 41 | waitress: waiter 42 | woman doctor: doctor 43 | woman scientist[s]?: scientist(s) 44 | work(?:m[ae]n|wom[ae]n): worker(s) 45 | -------------------------------------------------------------------------------- /styles/Microsoft/GeneralURL.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "For a general audience, use 'address' rather than 'URL'." 3 | link: https://docs.microsoft.com/en-us/style-guide/urls-web-addresses 4 | level: warning 5 | action: 6 | name: replace 7 | params: 8 | - URL 9 | - address 10 | tokens: 11 | - URL 12 | -------------------------------------------------------------------------------- /styles/Microsoft/HeadingAcronyms.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Avoid using acronyms in a title or heading." 3 | link: https://docs.microsoft.com/en-us/style-guide/acronyms#be-careful-with-acronyms-in-titles-and-headings 4 | level: warning 5 | scope: heading 6 | tokens: 7 | - '[A-Z]{2,4}' 8 | -------------------------------------------------------------------------------- /styles/Microsoft/HeadingColons.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Capitalize '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/colons 4 | nonword: true 5 | level: error 6 | scope: heading 7 | tokens: 8 | - ':\s[a-z]' 9 | -------------------------------------------------------------------------------- /styles/Microsoft/HeadingPunctuation.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't use end punctuation in headings." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods 4 | nonword: true 5 | level: warning 6 | scope: heading 7 | action: 8 | name: edit 9 | params: 10 | - remove 11 | - '.?!' 12 | tokens: 13 | - '[a-z][.?!](?:\s|$)' 14 | -------------------------------------------------------------------------------- /styles/Microsoft/Headings.yml: -------------------------------------------------------------------------------- 1 | extends: capitalization 2 | message: "'%s' should use sentence-style capitalization." 3 | link: https://docs.microsoft.com/en-us/style-guide/capitalization 4 | level: suggestion 5 | scope: heading 6 | match: $sentence 7 | indicators: 8 | - ':' 9 | exceptions: 10 | - Azure 11 | - CLI 12 | - Code 13 | - Cosmos 14 | - Docker 15 | - Emmet 16 | - I 17 | - Kubernetes 18 | - Linux 19 | - macOS 20 | - Marketplace 21 | - MongoDB 22 | - REPL 23 | - Studio 24 | - TypeScript 25 | - URLs 26 | - Visual 27 | - VS 28 | - Windows 29 | -------------------------------------------------------------------------------- /styles/Microsoft/Hyphens.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' doesn't need a hyphen." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens 4 | level: warning 5 | ignorecase: false 6 | nonword: true 7 | action: 8 | name: edit 9 | params: 10 | - replace 11 | - '-' 12 | - ' ' 13 | tokens: 14 | - '\s[^\s-]+ly-' 15 | -------------------------------------------------------------------------------- /styles/Microsoft/Negative.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Form a negative number with an en dash, not a hyphen." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers 4 | nonword: true 5 | level: error 6 | action: 7 | name: edit 8 | params: 9 | - replace 10 | - '-' 11 | - '–' 12 | tokens: 13 | - '\s-\d+\s' 14 | -------------------------------------------------------------------------------- /styles/Microsoft/Ordinal.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't add -ly to an ordinal number." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers 4 | level: error 5 | action: 6 | name: edit 7 | params: 8 | - trim 9 | - ly 10 | tokens: 11 | - firstly 12 | - secondly 13 | - thirdly 14 | -------------------------------------------------------------------------------- /styles/Microsoft/OxfordComma.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use the Oxford comma in '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/commas 4 | scope: sentence 5 | level: suggestion 6 | nonword: true 7 | tokens: 8 | - '(?:[^\s,]+,){1,} \w+ (?:and|or) \w+[.?!]' 9 | -------------------------------------------------------------------------------- /styles/Microsoft/Passive.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' looks like passive voice." 3 | ignorecase: true 4 | level: suggestion 5 | raw: 6 | - \b(am|are|were|being|is|been|was|be)\b\s* 7 | tokens: 8 | - '[\w]+ed' 9 | - awoken 10 | - beat 11 | - become 12 | - been 13 | - begun 14 | - bent 15 | - beset 16 | - bet 17 | - bid 18 | - bidden 19 | - bitten 20 | - bled 21 | - blown 22 | - born 23 | - bought 24 | - bound 25 | - bred 26 | - broadcast 27 | - broken 28 | - brought 29 | - built 30 | - burnt 31 | - burst 32 | - cast 33 | - caught 34 | - chosen 35 | - clung 36 | - come 37 | - cost 38 | - crept 39 | - cut 40 | - dealt 41 | - dived 42 | - done 43 | - drawn 44 | - dreamt 45 | - driven 46 | - drunk 47 | - dug 48 | - eaten 49 | - fallen 50 | - fed 51 | - felt 52 | - fit 53 | - fled 54 | - flown 55 | - flung 56 | - forbidden 57 | - foregone 58 | - forgiven 59 | - forgotten 60 | - forsaken 61 | - fought 62 | - found 63 | - frozen 64 | - given 65 | - gone 66 | - gotten 67 | - ground 68 | - grown 69 | - heard 70 | - held 71 | - hidden 72 | - hit 73 | - hung 74 | - hurt 75 | - kept 76 | - knelt 77 | - knit 78 | - known 79 | - laid 80 | - lain 81 | - leapt 82 | - learnt 83 | - led 84 | - left 85 | - lent 86 | - let 87 | - lighted 88 | - lost 89 | - made 90 | - meant 91 | - met 92 | - misspelt 93 | - mistaken 94 | - mown 95 | - overcome 96 | - overdone 97 | - overtaken 98 | - overthrown 99 | - paid 100 | - pled 101 | - proven 102 | - put 103 | - quit 104 | - read 105 | - rid 106 | - ridden 107 | - risen 108 | - run 109 | - rung 110 | - said 111 | - sat 112 | - sawn 113 | - seen 114 | - sent 115 | - set 116 | - sewn 117 | - shaken 118 | - shaven 119 | - shed 120 | - shod 121 | - shone 122 | - shorn 123 | - shot 124 | - shown 125 | - shrunk 126 | - shut 127 | - slain 128 | - slept 129 | - slid 130 | - slit 131 | - slung 132 | - smitten 133 | - sold 134 | - sought 135 | - sown 136 | - sped 137 | - spent 138 | - spilt 139 | - spit 140 | - split 141 | - spoken 142 | - spread 143 | - sprung 144 | - spun 145 | - stolen 146 | - stood 147 | - stridden 148 | - striven 149 | - struck 150 | - strung 151 | - stuck 152 | - stung 153 | - stunk 154 | - sung 155 | - sunk 156 | - swept 157 | - swollen 158 | - sworn 159 | - swum 160 | - swung 161 | - taken 162 | - taught 163 | - thought 164 | - thrived 165 | - thrown 166 | - thrust 167 | - told 168 | - torn 169 | - trodden 170 | - understood 171 | - upheld 172 | - upset 173 | - wed 174 | - wept 175 | - withheld 176 | - withstood 177 | - woken 178 | - won 179 | - worn 180 | - wound 181 | - woven 182 | - written 183 | - wrung 184 | -------------------------------------------------------------------------------- /styles/Microsoft/Percentages.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use a numeral plus the units." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers 4 | nonword: true 5 | level: error 6 | tokens: 7 | - '\b[a-zA-z]+\spercent\b' 8 | -------------------------------------------------------------------------------- /styles/Microsoft/Quotes.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: 'Punctuation should be inside the quotes.' 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/quotation-marks 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '["“][^"”“]+["”][.,]' 8 | -------------------------------------------------------------------------------- /styles/Microsoft/RangeFormat.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use an en dash in a range of numbers." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers 4 | nonword: true 5 | level: error 6 | action: 7 | name: edit 8 | params: 9 | - replace 10 | - '-' 11 | - '–' 12 | tokens: 13 | - '\b\d+\s?[-]\s?\d+\b' 14 | -------------------------------------------------------------------------------- /styles/Microsoft/RangeTime.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use 'to' instead of a dash in '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/numbers 4 | nonword: true 5 | level: error 6 | action: 7 | name: edit 8 | params: 9 | - replace 10 | - '[-–]' 11 | - 'to' 12 | tokens: 13 | - '\b(?:AM|PM)\s?[-–]\s?.+(?:AM|PM)\b' 14 | -------------------------------------------------------------------------------- /styles/Microsoft/Ranges.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "In most cases, use 'from' or 'through' to describe a range of numbers." 3 | link: 'https://docs.microsoft.com/en-us/style-guide/numbers' 4 | nonword: true 5 | level: warning 6 | tokens: 7 | - '\b\d+\s?[-–]\s?\d+\b' 8 | -------------------------------------------------------------------------------- /styles/Microsoft/Semicolon.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Try to simplify this sentence." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/semicolons 4 | nonword: true 5 | scope: sentence 6 | level: suggestion 7 | tokens: 8 | - ';' 9 | -------------------------------------------------------------------------------- /styles/Microsoft/SentenceLength.yml: -------------------------------------------------------------------------------- 1 | extends: occurrence 2 | message: "Try to keep sentences short (< 30 words)." 3 | scope: sentence 4 | level: suggestion 5 | max: 30 6 | token: \b(\w+)\b 7 | 8 | -------------------------------------------------------------------------------- /styles/Microsoft/Spacing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' should have one space." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '[a-z][.?!] {2,}[A-Z]' 8 | - '[a-z][.?!][A-Z]' 9 | -------------------------------------------------------------------------------- /styles/Microsoft/Suspended.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't use '%s' unless space is limited." 3 | link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens 4 | ignorecase: true 5 | level: warning 6 | tokens: 7 | - '\w+- and \w+-' 8 | -------------------------------------------------------------------------------- /styles/Microsoft/Terms.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Prefer '%s' over '%s'." 3 | level: warning 4 | ignorecase: true 5 | action: 6 | name: replace 7 | swap: 8 | '(?:agent|virtual assistant|intelligent personal assistant)': personal digital assistant 9 | '(?:drive C:|drive C>|C: drive)': drive C 10 | '(?:internet bot|web robot)s?': bot(s) 11 | '(?:microsoft cloud|the cloud)': cloud 12 | '(?:mobile|smart) ?phone': phone 13 | '24/7': every day 14 | 'audio(?:-| )book': audiobook 15 | 'back(?:-| )light': backlight 16 | 'chat ?bots?': chatbot(s) 17 | adaptor: adapter 18 | administrate: administer 19 | afterwards: afterward 20 | alphabetic: alphabetical 21 | alphanumerical: alphanumeric 22 | anti-aliasing: antialiasing 23 | anti-malware: antimalware 24 | anti-spyware: antispyware 25 | anti-virus: antivirus 26 | appendixes: appendices 27 | artificial intelligence: artificial intelligence 28 | assembler: assembly language 29 | bpp: bpp 30 | bps: bps 31 | caap: CaaP 32 | conversation-as-a-platform: conversation as a platform 33 | eb: EB 34 | gb: GB 35 | gbps: Gbps 36 | kb: KB 37 | keypress: keystroke 38 | mb: MB 39 | pb: PB 40 | tb: TB 41 | zb: ZB 42 | viz: namely 43 | ergo: therefore 44 | -------------------------------------------------------------------------------- /styles/Microsoft/URLFormat.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Use '%s' instead of '%s'." 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: replace 7 | swap: 8 | URL for: URL of 9 | an URL: a URL 10 | 11 | -------------------------------------------------------------------------------- /styles/Microsoft/Units.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't spell out the number in '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/units-of-measure-terms 4 | level: error 5 | raw: 6 | - '[a-zA-Z]+\s' 7 | tokens: 8 | - '(?:centi|milli)?meters' 9 | - '(?:kilo)?grams' 10 | - '(?:kilo)?meters' 11 | - '(?:mega)?pixels' 12 | - cm 13 | - inches 14 | - lb 15 | - miles 16 | - pounds 17 | -------------------------------------------------------------------------------- /styles/Microsoft/Vocab.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Verify your use of '%s' with the A-Z word list." 3 | link: 'https://docs.microsoft.com/en-us/style-guide' 4 | level: suggestion 5 | ignorecase: true 6 | tokens: 7 | - above 8 | - accessible 9 | - actionable 10 | - against 11 | - alarm 12 | - alert 13 | - alias 14 | - allows? 15 | - and/or 16 | - as well as 17 | - assure 18 | - author 19 | - avg 20 | - beta 21 | - ensure 22 | - he 23 | - insure 24 | - sample 25 | - she 26 | -------------------------------------------------------------------------------- /styles/Microsoft/We.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Try to avoid using first-person plural like '%s'." 3 | link: https://docs.microsoft.com/en-us/style-guide/grammar/person#avoid-first-person-plural 4 | level: warning 5 | ignorecase: true 6 | tokens: 7 | - we 8 | - we'(?:ve|re) 9 | - ours? 10 | - us 11 | - let's 12 | -------------------------------------------------------------------------------- /styles/Microsoft/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "feed": "https://github.com/errata-ai/Microsoft/releases.atom", 3 | "vale_version": ">=1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /styles/Readability/AutomatedReadability.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the Automated Readability Index (%s) below 8." 3 | link: https://en.wikipedia.org/wiki/Automated_readability_index 4 | 5 | formula: | 6 | (4.71 * (characters / words)) + (0.5 * (words / sentences)) - 21.43 7 | 8 | condition: "> 8" 9 | -------------------------------------------------------------------------------- /styles/Readability/ColemanLiau.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the Coleman–Liau Index grade (%s) below 19." 3 | link: https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index 4 | 5 | formula: | 6 | (0.0588 * (characters / words) * 100) - (0.296 * (sentences / words) * 100) - 15.8 7 | 8 | condition: "> 9" 9 | -------------------------------------------------------------------------------- /styles/Readability/FleschKincaid.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the Flesch–Kincaid grade level (%s) below 8." 3 | link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests 4 | 5 | formula: | 6 | (0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59 7 | 8 | condition: "> 8" 9 | -------------------------------------------------------------------------------- /styles/Readability/FleschReadingEase.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the Flesch reading ease score (%s) above 70." 3 | link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests 4 | 5 | formula: | 6 | 206.835 - (1.015 * (words / sentences)) - (84.6 * (syllables / words)) 7 | 8 | condition: "< 70" 9 | -------------------------------------------------------------------------------- /styles/Readability/GunningFog.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the Gunning-Fog index (%s) below 10." 3 | link: https://en.wikipedia.org/wiki/Gunning_fog_index 4 | 5 | formula: | 6 | 0.4 * ((words / sentences) + 100 * (complex_words / words)) 7 | 8 | condition: "> 10" 9 | -------------------------------------------------------------------------------- /styles/Readability/LIX.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the LIX score (%s) below 35." 3 | 4 | link: https://en.wikipedia.org/wiki/Lix_(readability_test) 5 | # Very Easy: 20 - 25 6 | # 7 | # Easy: 30 - 35 8 | # 9 | # Medium: 40 - 45 10 | # 11 | # Difficult: 50 - 55 12 | # 13 | # Very Difficult: 60+ 14 | formula: | 15 | (words / sentences) + ((long_words * 100) / words) 16 | 17 | condition: "> 35" 18 | -------------------------------------------------------------------------------- /styles/Readability/SMOG.yml: -------------------------------------------------------------------------------- 1 | extends: metric 2 | message: "Try to keep the SMOG grade (%s) below 10." 3 | link: https://en.wikipedia.org/wiki/SMOG 4 | 5 | formula: | 6 | 1.0430 * math.sqrt((polysyllabic_words * 30.0) / sentences) + 3.1291 7 | 8 | condition: "> 10" 9 | -------------------------------------------------------------------------------- /styles/Readability/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "feed": "https://github.com/errata-ai/Readability/releases.atom", 3 | "vale_version": ">=2.13.0" 4 | } -------------------------------------------------------------------------------- /styles/Vocab/Documentation/accept.txt: -------------------------------------------------------------------------------- 1 | h.N 2 | alias 3 | d\'uh 4 | [lL]odash 5 | [rR]amdajs 6 | [pP]urescript 7 | repo 8 | Namespace 9 | NOT 10 | Numerics 11 | ZERO -------------------------------------------------------------------------------- /styles/alex/Condescending.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: existence 3 | message: Using '%s' may come across as condescending. 4 | link: https://css-tricks.com/words-avoid-educational-writing/ 5 | level: error 6 | ignorecase: true 7 | tokens: 8 | - obvious 9 | - obviously 10 | - simple 11 | - simply 12 | - easy 13 | - easily 14 | - of course 15 | - clearly 16 | - everyone knows 17 | -------------------------------------------------------------------------------- /styles/alex/LGBTQ.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: substitution 3 | message: Consider using '%s' instead of '%s'. 4 | ignorecase: true 5 | level: warning 6 | action: 7 | name: replace 8 | swap: 9 | bathroom bill: non-discrimination law|non-discrimination ordinance 10 | bi: bisexual 11 | biologically female: assigned female at birth|designated female at birth 12 | biologically male: assigned male at birth|designated male at birth 13 | born a man: assigned male at birth|designated male at birth 14 | born a woman: assigned female at birth|designated female at birth 15 | dyke: gay 16 | fag: gay 17 | faggot: gay 18 | gay agenda: gay issues 19 | gay lifestyle: gay lives|gay/lesbian lives 20 | gay rights: equal rights|civil rights for gay people 21 | gender pronoun: pronoun|pronouns 22 | gender pronouns: pronoun|pronouns 23 | genetically female: assigned female at birth|designated female at birth 24 | genetically male: assigned male at birth|designated male at birth 25 | hermaphrodite: person who is intersex|person|intersex person 26 | hermaphroditic: intersex 27 | heshe: transgender person|person 28 | homo: gay 29 | homosexual: gay|gay man|lesbian|gay person/people 30 | homosexual agenda: gay issues 31 | homosexual couple: couple 32 | homosexual lifestyle: gay lives|gay/lesbian lives 33 | homosexual marriage: gay marriage|same-sex marriage 34 | homosexual relations: relationship 35 | homosexual relationship: relationship 36 | preferred pronoun: pronoun|pronouns 37 | preferred pronouns: pronoun|pronouns 38 | pseudo hermaphrodite: person who is intersex|person|intersex person 39 | pseudo hermaphroditic: intersex 40 | pseudohermaphrodite: person who is intersex|person|intersex person 41 | pseudohermaphroditic: intersex 42 | sex change: transition|gender confirmation surgery 43 | sex change operation: sex reassignment surgery|gender confirmation surgery 44 | sexchange: transition|gender confirmation surgery 45 | sexual preference: sexual orientation|orientation 46 | she male: transgender person|person 47 | shehe: transgender person|person 48 | shemale: transgender person|person 49 | sodomite: gay 50 | special rights: equal rights|civil rights for gay people 51 | tranny: transgender 52 | transgendered: transgender 53 | transgenderism: being transgender|the movement for transgender equality 54 | transgenders: transgender people 55 | transvestite: cross-dresser 56 | -------------------------------------------------------------------------------- /styles/alex/Press.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: substitution 3 | message: Consider using '%s' instead of '%s'. 4 | ignorecase: true 5 | level: warning 6 | action: 7 | name: replace 8 | swap: 9 | islamist: muslim|person of Islamic faith|fanatic|zealot|follower of islam|follower 10 | of the islamic faith 11 | islamists: muslims|people of Islamic faith|fanatics|zealots 12 | -------------------------------------------------------------------------------- /styles/alex/README.md: -------------------------------------------------------------------------------- 1 | Based on [alex](https://github.com/get-alex/alex). 2 | 3 | > Catch insensitive, inconsiderate writing 4 | 5 | ``` 6 | (The MIT License) 7 | 8 | Copyright (c) 2015 Titus Wormer 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | ``` 28 | -------------------------------------------------------------------------------- /styles/alex/Suicide.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: substitution 3 | message: When referring to a person, consider using '%s' instead of '%s'. 4 | ignorecase: true 5 | level: warning 6 | action: 7 | name: replace 8 | swap: 9 | commit suicide: die by suicide 10 | committed suicide: died by suicide 11 | complete suicide: die by suicide 12 | completed suicide: died by suicide 13 | epidemic of suicides: rise in suicides 14 | failed attempt: suicide attempt|attempted suicide 15 | failed suicide: suicide attempt|attempted suicide 16 | hang: the app froze|the app stopped responding|the app stopped responding to events|the 17 | app became unresponsive 18 | hanged: the app froze|the app stopped responding|the app stopped responding to events|the 19 | app became unresponsive 20 | successful suicide: die by suicide 21 | suicide epidemic: rise in suicides 22 | suicide failure: suicide attempt|attempted suicide 23 | suicide note: a note from the deceased 24 | suicide pact: rise in suicides 25 | -------------------------------------------------------------------------------- /styles/alex/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "feed": "https://github.com/errata-ai/alex/releases.atom", 3 | "vale_version": ">=1.0.0" 4 | } -------------------------------------------------------------------------------- /styles/proselint/Airlinese.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is airlinese." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - enplan(?:e|ed|ing|ement) 7 | - deplan(?:e|ed|ing|ement) 8 | - taking off momentarily 9 | -------------------------------------------------------------------------------- /styles/proselint/AnimalLabels.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Consider using '%s' instead of '%s'." 3 | level: error 4 | action: 5 | name: replace 6 | swap: 7 | (?:bull|ox)-like: taurine 8 | (?:calf|veal)-like: vituline 9 | (?:crow|raven)-like: corvine 10 | (?:leopard|panther)-like: pardine 11 | bird-like: avine 12 | centipede-like: scolopendrine 13 | crab-like: cancrine 14 | crocodile-like: crocodiline 15 | deer-like: damine 16 | eagle-like: aquiline 17 | earthworm-like: lumbricine 18 | falcon-like: falconine 19 | ferine: wild animal-like 20 | fish-like: piscine 21 | fox-like: vulpine 22 | frog-like: ranine 23 | goat-like: hircine 24 | goose-like: anserine 25 | gull-like: laridine 26 | hare-like: leporine 27 | hawk-like: accipitrine 28 | hippopotamus-like: hippopotamine 29 | lizard-like: lacertine 30 | mongoose-like: viverrine 31 | mouse-like: murine 32 | ostrich-like: struthionine 33 | peacock-like: pavonine 34 | porcupine-like: hystricine 35 | rattlesnake-like: crotaline 36 | sable-like: zibeline 37 | sheep-like: ovine 38 | shrew-like: soricine 39 | sparrow-like: passerine 40 | swallow-like: hirundine 41 | swine-like: suilline 42 | tiger-like: tigrine 43 | viper-like: viperine 44 | vulture-like: vulturine 45 | wasp-like: vespine 46 | wolf-like: lupine 47 | woodpecker-like: picine 48 | zebra-like: zebrine 49 | -------------------------------------------------------------------------------- /styles/proselint/Annotations.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' left in text." 3 | ignorecase: false 4 | level: error 5 | tokens: 6 | - XXX 7 | - FIXME 8 | - TODO 9 | - NOTE 10 | -------------------------------------------------------------------------------- /styles/proselint/Apologizing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Excessive apologizing: '%s'" 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: remove 7 | tokens: 8 | - More research is needed 9 | -------------------------------------------------------------------------------- /styles/proselint/Archaisms.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is archaic." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - alack 7 | - anent 8 | - begat 9 | - belike 10 | - betimes 11 | - boughten 12 | - brocage 13 | - brokage 14 | - camarade 15 | - chiefer 16 | - chiefest 17 | - Christiana 18 | - completely obsolescent 19 | - cozen 20 | - divers 21 | - deflexion 22 | - fain 23 | - forsooth 24 | - foreclose from 25 | - haply 26 | - howbeit 27 | - illumine 28 | - in sooth 29 | - maugre 30 | - meseems 31 | - methinks 32 | - nigh 33 | - peradventure 34 | - perchance 35 | - saith 36 | - shew 37 | - sistren 38 | - spake 39 | - to wit 40 | - verily 41 | - whilom 42 | - withal 43 | - wot 44 | - enclosed please find 45 | - please find enclosed 46 | - enclosed herewith 47 | - enclosed herein 48 | - inforce 49 | - ex postfacto 50 | - foreclose from 51 | - forewent 52 | - for ever 53 | -------------------------------------------------------------------------------- /styles/proselint/But.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Do not start a paragraph with a 'but'." 3 | level: error 4 | scope: paragraph 5 | action: 6 | name: remove 7 | tokens: 8 | - ^But 9 | -------------------------------------------------------------------------------- /styles/proselint/CorporateSpeak.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is corporate speak." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - at the end of the day 7 | - back to the drawing board 8 | - hit the ground running 9 | - get the ball rolling 10 | - low-hanging fruit 11 | - thrown under the bus 12 | - think outside the box 13 | - let's touch base 14 | - get my manager's blessing 15 | - it's on my radar 16 | - ping me 17 | - i don't have the bandwidth 18 | - no brainer 19 | - par for the course 20 | - bang for your buck 21 | - synergy 22 | - move the goal post 23 | - apples to apples 24 | - win-win 25 | - circle back around 26 | - all hands on deck 27 | - take this offline 28 | - drill-down 29 | - elephant in the room 30 | - on my plate 31 | -------------------------------------------------------------------------------- /styles/proselint/Currency.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Incorrect use of symbols in '%s'." 3 | ignorecase: true 4 | raw: 5 | - \$[\d]* ?(?:dollars|usd|us dollars) 6 | -------------------------------------------------------------------------------- /styles/proselint/Cursing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Consider replacing '%s'." 3 | level: error 4 | ignorecase: true 5 | tokens: 6 | - shit 7 | - piss 8 | - fuck 9 | - cunt 10 | - cocksucker 11 | - motherfucker 12 | - tits 13 | - fart 14 | - turd 15 | - twat 16 | -------------------------------------------------------------------------------- /styles/proselint/DateCase.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: With lowercase letters, the periods are standard. 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2} ?[ap]m\b' 8 | -------------------------------------------------------------------------------- /styles/proselint/DateMidnight.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use 'midnight' or 'noon'." 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '12 ?[ap]\.?m\.?' 8 | -------------------------------------------------------------------------------- /styles/proselint/DateRedundancy.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'a.m.' is always morning; 'p.m.' is always night." 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2} ?a\.?m\.? in the morning' 8 | - '\d{1,2} ?p\.?m\.? in the evening' 9 | - '\d{1,2} ?p\.?m\.? at night' 10 | - '\d{1,2} ?p\.?m\.? in the afternoon' 11 | -------------------------------------------------------------------------------- /styles/proselint/DateSpacing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "It's standard to put a space before '%s'" 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2}[ap]\.?m\.?' 8 | -------------------------------------------------------------------------------- /styles/proselint/DenizenLabels.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: Did you mean '%s'? 3 | ignorecase: false 4 | action: 5 | name: replace 6 | swap: 7 | (?:Afrikaaner|Afrikander): Afrikaner 8 | (?:Hong Kongite|Hong Kongian): Hong Konger 9 | (?:Indianan|Indianian): Hoosier 10 | (?:Michiganite|Michiganian): Michigander 11 | (?:New Hampshireite|New Hampshireman): New Hampshirite 12 | (?:Newcastlite|Newcastleite): Novocastrian 13 | (?:Providencian|Providencer): Providentian 14 | (?:Trentian|Trentonian): Tridentine 15 | (?:Warsawer|Warsawian): Varsovian 16 | (?:Wolverhamptonite|Wolverhamptonian): Wulfrunian 17 | Alabaman: Alabamian 18 | Albuquerquian: Albuquerquean 19 | Anchoragite: Anchorageite 20 | Arizonian: Arizonan 21 | Arkansawyer: Arkansan 22 | Belarusan: Belarusian 23 | Cayman Islander: Caymanian 24 | Coloradoan: Coloradan 25 | Connecticuter: Nutmegger 26 | Fairbanksian: Fairbanksan 27 | Fort Worther: Fort Worthian 28 | Grenadian: Grenadan 29 | Halifaxer: Haligonian 30 | Hartlepoolian: Hartlepudlian 31 | Illinoisian: Illinoisan 32 | Iowegian: Iowan 33 | Leedsian: Leodenisian 34 | Liverpoolian: Liverpudlian 35 | Los Angelean: Angeleno 36 | Manchesterian: Mancunian 37 | Minneapolisian: Minneapolitan 38 | Missouran: Missourian 39 | Monacan: Monegasque 40 | Neopolitan: Neapolitan 41 | New Jerseyite: New Jerseyan 42 | New Orleansian: New Orleanian 43 | Oklahoma Citian: Oklahoma Cityan 44 | Oklahomian: Oklahoman 45 | Saudi Arabian: Saudi 46 | Seattlite: Seattleite 47 | Surinamer: Surinamese 48 | Tallahassean: Tallahasseean 49 | Tennesseean: Tennessean 50 | Trois-Rivièrester: Trifluvian 51 | Utahan: Utahn 52 | Valladolidian: Vallisoletano 53 | -------------------------------------------------------------------------------- /styles/proselint/Diacritical.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: Consider using '%s' instead of '%s'. 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: replace 7 | swap: 8 | beau ideal: beau idéal 9 | boutonniere: boutonnière 10 | bric-a-brac: bric-à-brac 11 | cafe: café 12 | cause celebre: cause célèbre 13 | chevre: chèvre 14 | cliche: cliché 15 | consomme: consommé 16 | coup de grace: coup de grâce 17 | crudites: crudités 18 | creme brulee: crème brûlée 19 | creme de menthe: crème de menthe 20 | creme fraice: crème fraîche 21 | creme fresh: crème fraîche 22 | crepe: crêpe 23 | debutante: débutante 24 | decor: décor 25 | deja vu: déjà vu 26 | denouement: dénouement 27 | facade: façade 28 | fiance: fiancé 29 | fiancee: fiancée 30 | flambe: flambé 31 | garcon: garçon 32 | lycee: lycée 33 | maitre d: maître d 34 | menage a trois: ménage à trois 35 | negligee: négligée 36 | protege: protégé 37 | protegee: protégée 38 | puree: purée 39 | my resume: my résumé 40 | your resume: your résumé 41 | his resume: his résumé 42 | her resume: her résumé 43 | a resume: a résumé 44 | the resume: the résumé 45 | risque: risqué 46 | roue: roué 47 | soiree: soirée 48 | souffle: soufflé 49 | soupcon: soupçon 50 | touche: touché 51 | tete-a-tete: tête-à-tête 52 | voila: voilà 53 | a la carte: à la carte 54 | a la mode: à la mode 55 | emigre: émigré 56 | 57 | # Spanish loanwords 58 | El Nino: El Niño 59 | jalapeno: jalapeño 60 | La Nina: La Niña 61 | pina colada: piña colada 62 | senor: señor 63 | senora: señora 64 | senorita: señorita 65 | 66 | # Portuguese loanwords 67 | acai: açaí 68 | 69 | # German loanwords 70 | doppelganger: doppelgänger 71 | Fuhrer: Führer 72 | Gewurztraminer: Gewürztraminer 73 | vis-a-vis: vis-à-vis 74 | Ubermensch: Übermensch 75 | 76 | # Swedish loanwords 77 | filmjolk: filmjölk 78 | smorgasbord: smörgåsbord 79 | 80 | # Names, places, and companies 81 | Beyonce: Beyoncé 82 | Bronte: Brontë 83 | Champs-Elysees: Champs-Élysées 84 | Citroen: Citroën 85 | Curacao: Curaçao 86 | Lowenbrau: Löwenbräu 87 | Monegasque: Monégasque 88 | Motley Crue: Mötley Crüe 89 | Nescafe: Nescafé 90 | Queensryche: Queensrÿche 91 | Quebec: Québec 92 | Quebecois: Québécois 93 | Angstrom: Ångström 94 | angstrom: ångström 95 | Skoda: Škoda 96 | -------------------------------------------------------------------------------- /styles/proselint/GenderBias.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: Consider using '%s' instead of '%s'. 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: replace 7 | swap: 8 | (?:alumnae|alumni): graduates 9 | (?:alumna|alumnus): graduate 10 | air(?:m[ae]n|wom[ae]n): pilot(s) 11 | anchor(?:m[ae]n|wom[ae]n): anchor(s) 12 | authoress: author 13 | camera(?:m[ae]n|wom[ae]n): camera operator(s) 14 | chair(?:m[ae]n|wom[ae]n): chair(s) 15 | congress(?:m[ae]n|wom[ae]n): member(s) of congress 16 | door(?:m[ae]|wom[ae]n): concierge(s) 17 | draft(?:m[ae]n|wom[ae]n): drafter(s) 18 | fire(?:m[ae]n|wom[ae]n): firefighter(s) 19 | fisher(?:m[ae]n|wom[ae]n): fisher(s) 20 | fresh(?:m[ae]n|wom[ae]n): first-year student(s) 21 | garbage(?:m[ae]n|wom[ae]n): waste collector(s) 22 | lady lawyer: lawyer 23 | ladylike: courteous 24 | landlord: building manager 25 | mail(?:m[ae]n|wom[ae]n): mail carriers 26 | man and wife: husband and wife 27 | man enough: strong enough 28 | mankind: human kind 29 | manmade: manufactured 30 | men and girls: men and women 31 | middle(?:m[ae]n|wom[ae]n): intermediary 32 | news(?:m[ae]n|wom[ae]n): journalist(s) 33 | ombuds(?:man|woman): ombuds 34 | oneupmanship: upstaging 35 | poetess: poet 36 | police(?:m[ae]n|wom[ae]n): police officer(s) 37 | repair(?:m[ae]n|wom[ae]n): technician(s) 38 | sales(?:m[ae]n|wom[ae]n): salesperson or sales people 39 | service(?:m[ae]n|wom[ae]n): soldier(s) 40 | steward(?:ess)?: flight attendant 41 | tribes(?:m[ae]n|wom[ae]n): tribe member(s) 42 | waitress: waiter 43 | woman doctor: doctor 44 | woman scientist[s]?: scientist(s) 45 | work(?:m[ae]n|wom[ae]n): worker(s) 46 | -------------------------------------------------------------------------------- /styles/proselint/GroupTerms.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: Consider using '%s' instead of '%s'. 3 | ignorecase: true 4 | action: 5 | name: replace 6 | swap: 7 | (?:bunch|group|pack|flock) of chickens: brood of chickens 8 | (?:bunch|group|pack|flock) of crows: murder of crows 9 | (?:bunch|group|pack|flock) of hawks: cast of hawks 10 | (?:bunch|group|pack|flock) of parrots: pandemonium of parrots 11 | (?:bunch|group|pack|flock) of peacocks: muster of peacocks 12 | (?:bunch|group|pack|flock) of penguins: muster of penguins 13 | (?:bunch|group|pack|flock) of sparrows: host of sparrows 14 | (?:bunch|group|pack|flock) of turkeys: rafter of turkeys 15 | (?:bunch|group|pack|flock) of woodpeckers: descent of woodpeckers 16 | (?:bunch|group|pack|herd) of apes: shrewdness of apes 17 | (?:bunch|group|pack|herd) of baboons: troop of baboons 18 | (?:bunch|group|pack|herd) of badgers: cete of badgers 19 | (?:bunch|group|pack|herd) of bears: sloth of bears 20 | (?:bunch|group|pack|herd) of bullfinches: bellowing of bullfinches 21 | (?:bunch|group|pack|herd) of bullocks: drove of bullocks 22 | (?:bunch|group|pack|herd) of caterpillars: army of caterpillars 23 | (?:bunch|group|pack|herd) of cats: clowder of cats 24 | (?:bunch|group|pack|herd) of colts: rag of colts 25 | (?:bunch|group|pack|herd) of crocodiles: bask of crocodiles 26 | (?:bunch|group|pack|herd) of dolphins: school of dolphins 27 | (?:bunch|group|pack|herd) of foxes: skulk of foxes 28 | (?:bunch|group|pack|herd) of gorillas: band of gorillas 29 | (?:bunch|group|pack|herd) of hippopotami: bloat of hippopotami 30 | (?:bunch|group|pack|herd) of horses: drove of horses 31 | (?:bunch|group|pack|herd) of jellyfish: fluther of jellyfish 32 | (?:bunch|group|pack|herd) of kangeroos: mob of kangeroos 33 | (?:bunch|group|pack|herd) of monkeys: troop of monkeys 34 | (?:bunch|group|pack|herd) of oxen: yoke of oxen 35 | (?:bunch|group|pack|herd) of rhinoceros: crash of rhinoceros 36 | (?:bunch|group|pack|herd) of wild boar: sounder of wild boar 37 | (?:bunch|group|pack|herd) of wild pigs: drift of wild pigs 38 | (?:bunch|group|pack|herd) of zebras: zeal of wild pigs 39 | (?:bunch|group|pack|school) of trout: hover of trout 40 | -------------------------------------------------------------------------------- /styles/proselint/Hedging.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is hedging." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - I would argue that 7 | - ', so to speak' 8 | - to a certain degree 9 | -------------------------------------------------------------------------------- /styles/proselint/Hyperbole.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is hyperbolic." 3 | level: error 4 | nonword: true 5 | tokens: 6 | - '[a-z]+[!?]{2,}' 7 | -------------------------------------------------------------------------------- /styles/proselint/Jargon.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is jargon." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - in the affirmative 7 | - in the negative 8 | - agendize 9 | - per your order 10 | - per your request 11 | - disincentivize 12 | -------------------------------------------------------------------------------- /styles/proselint/LGBTOffensive.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is offensive. Remove it or consider the context." 3 | ignorecase: true 4 | tokens: 5 | - fag 6 | - faggot 7 | - dyke 8 | - sodomite 9 | - homosexual agenda 10 | - gay agenda 11 | - transvestite 12 | - homosexual lifestyle 13 | - gay lifestyle 14 | -------------------------------------------------------------------------------- /styles/proselint/LGBTTerms.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Consider using '%s' instead of '%s'." 3 | ignorecase: true 4 | action: 5 | name: replace 6 | swap: 7 | homosexual man: gay man 8 | homosexual men: gay men 9 | homosexual woman: lesbian 10 | homosexual women: lesbians 11 | homosexual people: gay people 12 | homosexual couple: gay couple 13 | sexual preference: sexual orientation 14 | (?:admitted homosexual|avowed homosexual): openly gay 15 | special rights: equal rights 16 | -------------------------------------------------------------------------------- /styles/proselint/Malapropisms.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is a malapropism." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - the infinitesimal universe 7 | - a serial experience 8 | - attack my voracity 9 | -------------------------------------------------------------------------------- /styles/proselint/Nonwords.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Consider using '%s' instead of '%s'." 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: replace 7 | swap: 8 | affrontery: effrontery 9 | analyzation: analysis 10 | annoyment: annoyance 11 | confirmant: confirmand 12 | confirmants: confirmands 13 | conversate: converse 14 | crained: cranded 15 | discomforture: discomfort|discomfiture 16 | dispersement: disbursement|dispersal 17 | doubtlessly: doubtless|undoubtedly 18 | forebearance: forbearance 19 | improprietous: improper 20 | inclimate: inclement 21 | inimicable: inimical 22 | irregardless: regardless 23 | minimalize: minimize 24 | minimalized: minimized 25 | minimalizes: minimizes 26 | minimalizing: minimizing 27 | optimalize: optimize 28 | paralyzation: paralysis 29 | pettifogger: pettifog 30 | proprietous: proper 31 | relative inexpense: relatively low price|affordability 32 | seldomly: seldom 33 | thusly: thus 34 | uncategorically: categorically 35 | undoubtably: undoubtedly|indubitably 36 | unequivocable: unequivocal 37 | unmercilessly: mercilessly 38 | unrelentlessly: unrelentingly|relentlessly 39 | -------------------------------------------------------------------------------- /styles/proselint/Oxymorons.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is an oxymoron." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - amateur expert 7 | - increasingly less 8 | - advancing backwards 9 | - alludes explicitly to 10 | - explicitly alludes to 11 | - totally obsolescent 12 | - completely obsolescent 13 | - generally always 14 | - usually always 15 | - increasingly less 16 | - build down 17 | - conspicuous absence 18 | - exact estimate 19 | - found missing 20 | - intense apathy 21 | - mandatory choice 22 | - organized mess 23 | -------------------------------------------------------------------------------- /styles/proselint/P-Value.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "You should use more decimal places, unless '%s' is really true." 3 | ignorecase: true 4 | level: suggestion 5 | tokens: 6 | - 'p = 0\.0{2,4}' 7 | -------------------------------------------------------------------------------- /styles/proselint/RASSyndrome.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is redundant." 3 | level: error 4 | action: 5 | name: edit 6 | params: 7 | - split 8 | - ' ' 9 | - '0' 10 | tokens: 11 | - ABM missile 12 | - ACT test 13 | - ABM missiles 14 | - ABS braking system 15 | - ATM machine 16 | - CD disc 17 | - CPI Index 18 | - GPS system 19 | - GUI interface 20 | - HIV virus 21 | - ISBN number 22 | - LCD display 23 | - PDF format 24 | - PIN number 25 | - RAS syndrome 26 | - RIP in peace 27 | - please RSVP 28 | - SALT talks 29 | - SAT test 30 | - UPC codes 31 | -------------------------------------------------------------------------------- /styles/proselint/README.md: -------------------------------------------------------------------------------- 1 | Copyright © 2014–2015, Jordan Suchow, Michael Pacer, and Lara A. Ross 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | -------------------------------------------------------------------------------- /styles/proselint/Skunked.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is a bit of a skunked term — impossible to use without issue." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - bona fides 7 | - deceptively 8 | - decimate 9 | - effete 10 | - fulsome 11 | - hopefully 12 | - impassionate 13 | - Thankfully 14 | -------------------------------------------------------------------------------- /styles/proselint/Spelling.yml: -------------------------------------------------------------------------------- 1 | extends: consistency 2 | message: "Inconsistent spelling of '%s'." 3 | level: error 4 | ignorecase: true 5 | either: 6 | advisor: adviser 7 | centre: center 8 | colour: color 9 | emphasise: emphasize 10 | finalise: finalize 11 | focussed: focused 12 | labour: labor 13 | learnt: learned 14 | organise: organize 15 | organised: organized 16 | organising: organizing 17 | recognise: recognize 18 | -------------------------------------------------------------------------------- /styles/proselint/Typography.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: Consider using the '%s' symbol instead of '%s'. 3 | level: error 4 | nonword: true 5 | swap: 6 | '\.\.\.': … 7 | '\([cC]\)': © 8 | '\(TM\)': ™ 9 | '\(tm\)': ™ 10 | '\([rR]\)': ® 11 | '[0-9]+ ?x ?[0-9]+': × 12 | -------------------------------------------------------------------------------- /styles/proselint/Uncomparables.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is not comparable" 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: edit 7 | params: 8 | - split 9 | - ' ' 10 | - '1' 11 | raw: 12 | - \b(?:absolutely|most|more|less|least|very|quite|largely|extremely|increasingly|kind of|mildy|hardly|greatly|sort of)\b\s* 13 | tokens: 14 | - absolute 15 | - adequate 16 | - complete 17 | - correct 18 | - certain 19 | - devoid 20 | - entire 21 | - 'false' 22 | - fatal 23 | - favorite 24 | - final 25 | - ideal 26 | - impossible 27 | - inevitable 28 | - infinite 29 | - irrevocable 30 | - main 31 | - manifest 32 | - only 33 | - paramount 34 | - perfect 35 | - perpetual 36 | - possible 37 | - preferable 38 | - principal 39 | - singular 40 | - stationary 41 | - sufficient 42 | - 'true' 43 | - unanimous 44 | - unavoidable 45 | - unbroken 46 | - uniform 47 | - unique 48 | - universal 49 | - void 50 | - whole 51 | -------------------------------------------------------------------------------- /styles/proselint/Very.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Remove '%s'." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - very 7 | -------------------------------------------------------------------------------- /styles/proselint/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "jdkato", 3 | "description": "A Vale-compatible implementation of the proselint linter.", 4 | "email": "support@errata.ai", 5 | "lang": "en", 6 | "url": "https://github.com/errata-ai/proselint/releases/latest/download/proselint.zip", 7 | "feed": "https://github.com/errata-ai/proselint/releases.atom", 8 | "issues": "https://github.com/errata-ai/proselint/issues/new", 9 | "license": "BSD-3-Clause", 10 | "name": "proselint", 11 | "sources": [ 12 | "https://github.com/amperser/proselint" 13 | ], 14 | "vale_version": ">=1.0.0", 15 | "coverage": 0.0, 16 | "version": "0.1.0" 17 | } 18 | -------------------------------------------------------------------------------- /styles/write-good/E-Prime.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Try to avoid using '%s'." 3 | ignorecase: true 4 | level: suggestion 5 | tokens: 6 | - am 7 | - are 8 | - aren't 9 | - be 10 | - been 11 | - being 12 | - he's 13 | - here's 14 | - here's 15 | - how's 16 | - i'm 17 | - is 18 | - isn't 19 | - it's 20 | - she's 21 | - that's 22 | - there's 23 | - they're 24 | - was 25 | - wasn't 26 | - we're 27 | - were 28 | - weren't 29 | - what's 30 | - where's 31 | - who's 32 | - you're 33 | -------------------------------------------------------------------------------- /styles/write-good/Illusions.yml: -------------------------------------------------------------------------------- 1 | extends: repetition 2 | message: "'%s' is repeated!" 3 | level: warning 4 | alpha: true 5 | action: 6 | name: edit 7 | params: 8 | - truncate 9 | - " " 10 | tokens: 11 | - '[^\s]+' 12 | -------------------------------------------------------------------------------- /styles/write-good/Passive.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' may be passive voice. Use active voice if you can." 3 | ignorecase: true 4 | level: warning 5 | raw: 6 | - \b(am|are|were|being|is|been|was|be)\b\s* 7 | tokens: 8 | - '[\w]+ed' 9 | - awoken 10 | - beat 11 | - become 12 | - been 13 | - begun 14 | - bent 15 | - beset 16 | - bet 17 | - bid 18 | - bidden 19 | - bitten 20 | - bled 21 | - blown 22 | - born 23 | - bought 24 | - bound 25 | - bred 26 | - broadcast 27 | - broken 28 | - brought 29 | - built 30 | - burnt 31 | - burst 32 | - cast 33 | - caught 34 | - chosen 35 | - clung 36 | - come 37 | - cost 38 | - crept 39 | - cut 40 | - dealt 41 | - dived 42 | - done 43 | - drawn 44 | - dreamt 45 | - driven 46 | - drunk 47 | - dug 48 | - eaten 49 | - fallen 50 | - fed 51 | - felt 52 | - fit 53 | - fled 54 | - flown 55 | - flung 56 | - forbidden 57 | - foregone 58 | - forgiven 59 | - forgotten 60 | - forsaken 61 | - fought 62 | - found 63 | - frozen 64 | - given 65 | - gone 66 | - gotten 67 | - ground 68 | - grown 69 | - heard 70 | - held 71 | - hidden 72 | - hit 73 | - hung 74 | - hurt 75 | - kept 76 | - knelt 77 | - knit 78 | - known 79 | - laid 80 | - lain 81 | - leapt 82 | - learnt 83 | - led 84 | - left 85 | - lent 86 | - let 87 | - lighted 88 | - lost 89 | - made 90 | - meant 91 | - met 92 | - misspelt 93 | - mistaken 94 | - mown 95 | - overcome 96 | - overdone 97 | - overtaken 98 | - overthrown 99 | - paid 100 | - pled 101 | - proven 102 | - put 103 | - quit 104 | - read 105 | - rid 106 | - ridden 107 | - risen 108 | - run 109 | - rung 110 | - said 111 | - sat 112 | - sawn 113 | - seen 114 | - sent 115 | - set 116 | - sewn 117 | - shaken 118 | - shaven 119 | - shed 120 | - shod 121 | - shone 122 | - shorn 123 | - shot 124 | - shown 125 | - shrunk 126 | - shut 127 | - slain 128 | - slept 129 | - slid 130 | - slit 131 | - slung 132 | - smitten 133 | - sold 134 | - sought 135 | - sown 136 | - sped 137 | - spent 138 | - spilt 139 | - spit 140 | - split 141 | - spoken 142 | - spread 143 | - sprung 144 | - spun 145 | - stolen 146 | - stood 147 | - stridden 148 | - striven 149 | - struck 150 | - strung 151 | - stuck 152 | - stung 153 | - stunk 154 | - sung 155 | - sunk 156 | - swept 157 | - swollen 158 | - sworn 159 | - swum 160 | - swung 161 | - taken 162 | - taught 163 | - thought 164 | - thrived 165 | - thrown 166 | - thrust 167 | - told 168 | - torn 169 | - trodden 170 | - understood 171 | - upheld 172 | - upset 173 | - wed 174 | - wept 175 | - withheld 176 | - withstood 177 | - woken 178 | - won 179 | - worn 180 | - wound 181 | - woven 182 | - written 183 | - wrung 184 | -------------------------------------------------------------------------------- /styles/write-good/README.md: -------------------------------------------------------------------------------- 1 | Based on [write-good](https://github.com/btford/write-good). 2 | 3 | > Naive linter for English prose for developers who can't write good and wanna learn to do other stuff good too. 4 | 5 | ``` 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014 Brian Ford 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | ``` 28 | -------------------------------------------------------------------------------- /styles/write-good/So.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't start a sentence with '%s'." 3 | level: error 4 | raw: 5 | - '(?:[;-]\s)so[\s,]|\bSo[\s,]' 6 | -------------------------------------------------------------------------------- /styles/write-good/ThereIs.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Don't start a sentence with '%s'." 3 | ignorecase: false 4 | level: error 5 | raw: 6 | - '(?:[;-]\s)There\s(is|are)|\bThere\s(is|are)\b' 7 | -------------------------------------------------------------------------------- /styles/write-good/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "feed": "https://github.com/errata-ai/write-good/releases.atom", 3 | "vale_version": ">=1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/_setup.ps1: -------------------------------------------------------------------------------- 1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('RequireDirective', '')] 2 | Param( 3 | [String] $GroupName 4 | ) 5 | $Name = 'Prelude' 6 | if (Get-Module -Name $Name) { 7 | Remove-Module -Name $Name 8 | } 9 | Import-Module "${PSScriptRoot}\..\${Name}" 10 | "==> [INFO] Running tests for ${GroupName}..." | Write-Verbose -------------------------------------------------------------------------------- /tests/fixtures/.env: -------------------------------------------------------------------------------- 1 | THE_ANSWER=42 -------------------------------------------------------------------------------- /tests/fixtures/NAV21181.txt: -------------------------------------------------------------------------------- 1 | UNCLASSIFIED// 2 | ROUTINE 3 | R 231716Z AUG 21 MID200001067740U 4 | FM CNO WASHINGTON DC 5 | TO NAVADMIN 6 | INFO SECNAV WASHINGTON DC 7 | CNO WASHINGTON DC 8 | BT 9 | UNCLAS 10 | 11 | NAVADMIN 181/21 12 | 13 | MSGID/NAVADMIN/CNO WASHINGTON DC/CNO/AUG// 14 | 15 | SUBJ/OPNAVINST 3100.6K// 16 | 17 | RMKS/1. THIS NAVADMIN ANNOUNCES THE PUBLICATION OF OPNAVINST 3100.6K, 18 | SPECIAL INCIDENT REPORTING (OPREP-3 PINNACLE, OPREP-3 NAVY BLUE, AND OPREP-3 19 | NAVY UNIT SITREP) PROCEDURES. 20 | 21 | 2. OPNAVINST 3100.6J CH4 IS HEREBY CANCELLED. OPNAVINST 3100.6K IS THE ONLY 22 | AUTHORIZED SPECIAL INCIDENT REPORTING INSTRUCTION FOR FLEET USE. IT CAN 23 | BE DOWNLOADED AT THE DEPARTMENT OF THE NAVY ISSUANCES' NIPR WEBSITE ACCESSED 24 | AT: 25 | https://portal.secnav.navy.mil/orgs/OPNAV/DNS/DNS1/DNS15/FOUO%20Directives/Fo 26 | rms/AllItems.aspx 27 | 28 | 3. THIS INSTRUCTION HAS MAJOR UPDATES. OPERATIONAL MAJOR CHANGES INCLUDE: 29 | 3.A. DIRECT REPORTING TO NATIONAL MILITARY COMMAND CENTER FOR SOME MESSAGES. 30 | 3.B. ADDED UNMANNED SYSTEMS (HOSTILE AND GENERAL) REPORTING REQUIREMENTS. 31 | 3.C. UPDATED EMERGENCY ACTION MESSAGE COMMS OUTAGE REPORTING REQUIREMENTS. 32 | 3.D. UPDATED NARRATIVES FOR REPORTS RELATING TO NUCLEAR REACTORS AND NUCLEAR 33 | WEAPONS, PROVIDING CROSS REFERENCE BETWEEN ISSUES THAT COULD AFFECT EACH 34 | OTHER FOR CASUALTY PRIORITIZATION. 35 | 3.E. ADJUSTED THRESHOLDS FOR MISSING, LOST, STOLEN OR RECOVERED ARMS, 36 | AMMUNITION AND EXPLOSIVES. 37 | 3.F. UPDATED CONTACT INFORMATION FOR SOME FLEET MARITIME OPERATIONS CENTERS. 38 | 39 | 4. MAJOR PERSONNEL INCIDENT CHANGES INCLUDE: [SRB, EXTREMIST BEHAVIORS, 40 | BULLYING, ETC.] 41 | 4.A. ADDED PERSONNEL INCIDENT REPORTING FOR SUPREMACIST OR EXTREMIST 42 | BEHAVIORS. 43 | 4.B. ADDED NAVY INSIDER THREAT PLAD AND CONTACT INFORMATION. 44 | 4.C. PLAD UPDATES ARE DETAILED IN THE INSTRUCTION SUMMARY OF CHANGES. 45 | 46 | 5. POINTS OF CONTACT: LT WILLIAM MAYO, OPNAV N30/WATCH FLOOR ACTION 47 | OFFICER, COMM: (703) 692-9343, E-MAIL: WILLIAM.C.MAYO23.MIL@US.NAVY.MIL 48 | OR CDR JAKE WADSLEY, OPNAV N30 OPERATIONS AND INFORMATION, COMM: 49 | (703) 692-0644, E-MAIL: JAKE.T.WADSLEY.MIL@US.NAVY.MIL. 50 | 51 | 6. RELEASED BY VADM W. R. MERZ, DEPUTY CHIEF OF NAVAL OPERATIONS FOR 52 | OPERATIONS, PLANS AND STRATEGY N3/N5.// 53 | 54 | BT 55 | #0001 56 | NNNN 57 | UNCLASSIFIED// 58 | -------------------------------------------------------------------------------- /tests/fixtures/emma.txt: -------------------------------------------------------------------------------- 1 | It was most convenient to Emma not to make a direct reply to this 2 | assertion; she chose rather to take up her own line of the subject 3 | again. 4 | 5 | You are a very warm friend to Mr. Martin; but, as I said before, 6 | are unjust to Harriet. Harriet's claims to marry well are not so 7 | contemptible as you represent them. She is not a clever girl, but she 8 | has better sense than you are aware of, and does not deserve to have her 9 | understanding spoken of so slightingly. Waiving that point, however, and 10 | supposing her to be, as you describe her, only pretty and good-natured, 11 | let me tell you, that in the degree she possesses them, they are not 12 | trivial recommendations to the world in general, for she is, in fact, a 13 | beautiful girl, and must be thought so by ninety-nine people out of an 14 | hundred; and till it appears that men are much more philosophic on the 15 | subject of beauty than they are generally supposed; till they do fall 16 | in love with well-informed minds instead of handsome faces, a girl, with 17 | such loveliness as Harriet, has a certainty of being admired and sought 18 | after, of having the power of chusing from among many, consequently a 19 | claim to be nice. Her good-nature, too, is not so very slight a claim, 20 | comprehending, as it does, real, thorough sweetness of temper and 21 | manner, a very humble opinion of herself, and a great readiness to 22 | be pleased with other people. I am very much mistaken if your sex in 23 | general would not think such beauty, and such temper, the highest claims 24 | a woman could possess. 25 | 26 | Upon my word, Emma, to hear you abusing the reason you have, is almost 27 | enough to make me think so too. Better be without sense, than misapply 28 | it as you do. 29 | 30 | “To be sure!” cried she playfully. “I know _that_ is the feeling of 31 | you all. I know that such a girl as Harriet is exactly what every 32 | man delights in--what at once bewitches his senses and satisfies his 33 | judgment. Oh! Harriet may pick and chuse. Were you, yourself, ever to 34 | marry, she is the very woman for you. And is she, at seventeen, just 35 | entering into life, just beginning to be known, to be wondered at 36 | because she does not accept the first offer she receives? No--pray let 37 | her have time to look about her. -------------------------------------------------------------------------------- /tests/fixtures/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example Webpage 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 |
18 | 19 |

Some Random Text

20 |

21 | I'm baby fashion axe schlitz meh ennui 8-bit banh mi, photo booth normcore direct trade irony blue bottle shoreditch. 22 | Typewriter tilde ennui offal gastropub. Fingerstache brooklyn pour-over snackwave chia tofu, try-hard edison bulb readymade 23 | four loko sartorial tbh pop-up. Pop-up succulents etsy, cred lomo tofu tacos VHS ethical coloring 24 | book kickstarter meggings cray adaptogen. Vaporware palo santo meh, tousled roof party snackwave whatever venmo asymmetrical 25 | ethical pok pok chambray iPhone offal. Kitsch 8-bit taxidermy, subway tile retro wayfarers selfies. 26 |

27 |
28 |
29 |

Links

30 |
    31 |
  • A
  • 32 |
  • B
  • 33 |
  • C
  • 34 |
35 |
36 | 37 | -------------------------------------------------------------------------------- /tests/fixtures/example.txt: -------------------------------------------------------------------------------- 1 | Interloper jury mast spanker weigh anchor American Main hail-shot shrouds crimp lee gaff. 2 | Walk the plank cackle fruit run a shot across the bow yardarm bowsprit gunwalls loaded to 3 | the gunwalls yo-ho-ho pressgang chantey. Poop deck wench Blimey pressgang lad lee tackle 4 | gun swab brigantine. 5 | 6 | Spyglass doubloon log tender belay coxswain ho crack Jennys tea cup long boat pink. Warp 7 | list Admiral of the Black case shot run a rig provost gangplank fluke chase landlubber or 8 | just lubber. Aye reef topgallant coffer square-rigged pink grog blossom belay shrouds list. 9 | 10 | Letter of Marque Jack Tar Blimey heave down pirate keelhaul bilged on her anchor crack Jennys 11 | tea cup fire ship yo-ho-ho. Quarter bowsprit fluke sloop red ensign Pirate Round booty gally 12 | gangway draught. Gangway fathom mizzen strike colors smartly main sheet rum heave to fore coxswain. -------------------------------------------------------------------------------- /tests/fixtures/example.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/tests/fixtures/example.xlsx -------------------------------------------------------------------------------- /tests/fixtures/example_protected.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhwohlgemuth/pwsh-prelude/eb00147928c9659152ab90bdfd60df09da797bc3/tests/fixtures/example_protected.xlsx -------------------------------------------------------------------------------- /tests/fixtures/hosts: -------------------------------------------------------------------------------- 1 | # Copyright (c) 1993-2009 Microsoft Corp. 2 | # 3 | # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 4 | # 5 | # This file contains the mappings of IP addresses to host names. Each 6 | # entry should be kept on an individual line. The IP address should 7 | # be placed in the first column followed by the corresponding host name. 8 | # The IP address and the host name should be separated by at least one 9 | # space. 10 | # 11 | # Additionally, comments (such as these) may be inserted on individual 12 | # lines or following the machine name denoted by a '#' symbol. 13 | # 14 | # For example: 15 | # 16 | # 102.54.94.97 rhino.acme.com # source server 17 | # 38.25.63.10 x.acme.com # x client host 18 | 19 | # localhost name resolution is handled within DNS itself. 20 | # 127.0.0.1 localhost 21 | # ::1 localhost 22 | 192.168.0.111 foo 23 | 24 | 127.0.0.1 bar # some random comment 25 | # Added by Some Program 26 | 192.168.0.2 foo.bar.baz 27 | 192.168.0.3 foo bar baz 28 | 192.168.0.4 foo.bar.baz # some comment 29 | 30 | # I like to add spaces after the IP address and host name. 31 | 192.168.0.5 foo bar baz #some other comment -------------------------------------------------------------------------------- /tests/fixtures/profiles.ini: -------------------------------------------------------------------------------- 1 | [Install7CC1D22277FCE55A] 2 | Default=Profiles/mftmxdvc.default-release-1 3 | Locked=1 4 | 5 | ; foo 6 | [Profile2] 7 | Name=default-release-1 8 | IsRelative=1 9 | Path=Profiles/mftmxdvc.default-release-1 10 | 11 | [Profile1] 12 | Name=default-release 13 | IsRelative=1 14 | Path=Profiles/ym0gv7t8.default-release 15 | 16 | [Profile0] 17 | Name=Scoop 18 | IsRelative=0 19 | Path=C:\Users\jason\scoop\persist\firefox\profile 20 | Default=1 21 | 22 | [General] 23 | ; bar 24 | StartWithLastProfile=1 25 | Version=2 26 | 27 | [InstallD8C4FE840243EDBF] 28 | Default=Profiles/ym0gv7t8.default-release 29 | Locked=1 30 | 31 | -------------------------------------------------------------------------------- /tests/fixtures/template.txt: -------------------------------------------------------------------------------- 1 | { 2 | 'Name' = 'Jason' 3 | "Location" = {{ location }} 4 | $Type = {{ type }} 5 | } -------------------------------------------------------------------------------- /util/Invoke-FixPesterSetup.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Modules pester 2 | [CmdletBinding()] 3 | Param() 4 | 5 | $OneDriveModulePath = Join-Path $Env:OneDrive 'Documents\PowerShell\Modules' 6 | $Env:PSModulePath = "${OneDriveModulePath};$Env:PSModulePath" 7 | Remove-Module -Name pester 8 | Import-Module -Name pester -RequiredVersion 5.5.0 -------------------------------------------------------------------------------- /util/Invoke-Setup.ps1: -------------------------------------------------------------------------------- 1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('AdvancedFunctionHelpContent', '')] 2 | [CmdletBinding()] 3 | Param( 4 | [ValidateSet('windows', 'linux')] 5 | [String] $Platform = 'windows' 6 | ) 7 | if ($Platform -eq 'windows') { 8 | dotnet tool restore 9 | } 10 | Install-Module -Force -Scope CurrentUser -Name PSScriptAnalyzer 11 | Install-Module -Force -Scope CurrentUser -Name BuildHelpers 12 | Install-Module -Force -Scope CurrentUser -Name Pester -RequiredVersion 5.3.1 -------------------------------------------------------------------------------- /util/Uninstall-Pester.ps1: -------------------------------------------------------------------------------- 1 | #Requires -RunAsAdministrator 2 | 3 | function Uninstall-Pester ([switch]$All) { 4 | if ([IntPtr]::Size * 8 -ne 64) { throw 'Run this script from 64bit PowerShell.' } 5 | 6 | #Requires -RunAsAdministrator 7 | $PesterPath = foreach ($ProgramFiles in ($Env:ProgramFiles, ${Env:ProgramFiles(x86)})) { 8 | $Path = "$ProgramFiles\WindowsPowerShell\Modules\Pester" 9 | if ($Null -ne $ProgramFiles -and (Test-Path $Path)) { 10 | if ($All) { 11 | Get-Item $Path 12 | } 13 | else { 14 | Get-ChildItem "$Path\3.*" 15 | } 16 | } 17 | } 18 | 19 | 20 | if (-not $PesterPath) { 21 | "There are no Pester$(if (-not $All) {' 3'}) installations in Program Files and Program Files (x86) doing nothing." 22 | return 23 | } 24 | 25 | foreach ($PesterPath in $PesterPath) { 26 | takeown /F $PesterPath /A /R 27 | icacls $PesterPath /reset 28 | # grant permissions to Administrators group, but use SID to do 29 | # it because it is localized on non-us installations of Windows 30 | icacls $PesterPath /grant '*S-1-5-32-544:F' /inheritance:d /T 31 | Remove-Item -Path $PesterPath -Recurse -Force -Confirm:$False 32 | } 33 | } 34 | 35 | Uninstall-Pester --------------------------------------------------------------------------------