From c1a79ea0fd3a3afac9fcfb30c9a2971a10ae1f40 Mon Sep 17 00:00:00 2001 From: Maxwell Weru Date: Tue, 20 Feb 2024 09:42:10 +0300 Subject: [PATCH] Add codespell workflow --- .codespellrc | 5 +++++ .github/workflows/codespell.yml | 21 +++++++++++++++++++ .../InsightsShutdownFlushService.cs | 2 +- .../Extensions/ILoggerExtensions.cs | 2 +- server/main.bicep | 2 +- server/main.json | 2 +- 6 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..13c05a80 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,*.pdf,*.svg,pnpm-lock.yaml,yarn.lock +# some modules, parts of regexes, and variable names to ignore, some +# misspellings in fixtures/external responses we do not own +ignore-words-list = caf,bu,nwo,nd,kernal,crate,unparseable,couldn,defintions diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..df18e8f6 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,21 @@ +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/server/Tingle.Dependabot/ApplicationInsights/InsightsShutdownFlushService.cs b/server/Tingle.Dependabot/ApplicationInsights/InsightsShutdownFlushService.cs index 53fe0800..492802cc 100644 --- a/server/Tingle.Dependabot/ApplicationInsights/InsightsShutdownFlushService.cs +++ b/server/Tingle.Dependabot/ApplicationInsights/InsightsShutdownFlushService.cs @@ -13,7 +13,7 @@ public async Task StopAsync(CancellationToken cancellationToken) // Using "CancellationToken.None" ensures that the application doesn't stop until the telemetry data is flushed. // // If you want to use the "cancellationToken" argument, make sure to configure "HostOptions.ShutdownTimeout" with a sufficiently large duration, - // and silence the eventual "OperationCanceledException" exception. Otherwise, you will still be at risk of loosing telemetry data. + // and silence the eventual "OperationCanceledException" exception. Otherwise, you will still be at risk of losing telemetry data. var successfullyFlushed = await telemetryClient.FlushAsync(CancellationToken.None); if (!successfullyFlushed) { diff --git a/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs b/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs index b66bf53f..5eea294b 100644 --- a/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs +++ b/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs @@ -66,7 +66,7 @@ internal static partial class ILoggerExtensions [LoggerMessage(400, LogLevel.Debug, "Creating/Updating schedules for repository '{RepositoryId}' in project '{ProjectId}'")] public static partial void SchedulesUpdating(this ILogger logger, string? repositoryId, string? projectId); - [LoggerMessage(401, LogLevel.Error, "Timer call back does not have correct argument. Exepected '{ExpectedType}' but got '{ActualType}'")] + [LoggerMessage(401, LogLevel.Error, "Timer call back does not have correct argument. Expected '{ExpectedType}' but got '{ActualType}'")] public static partial void SchedulesTimerInvalidCallbackArgument(this ILogger logger, string? expectedType, string? actualType); [LoggerMessage(402, LogLevel.Warning, "Schedule was missed for {RepositoryId}({UpdateId}) in project '{ProjectId}'. Triggering now ...")] diff --git a/server/main.bicep b/server/main.bicep index 6d2004f4..0981e32b 100644 --- a/server/main.bicep +++ b/server/main.bicep @@ -6,7 +6,7 @@ param location string = resourceGroup().location @description('Name of the resources. Make sure it is unique e.g. dependabotcontoso to avoid conflicts or failures') param name string = 'dependabot' -@description('JSON array string fo projects to setup. E.g. [{"url":"https://dev.azure.com/tingle/dependabot","token":"dummy","AutoComplete":true}]') +@description('JSON array string for projects to setup. E.g. [{"url":"https://dev.azure.com/tingle/dependabot","token":"dummy","AutoComplete":true}]') param projectSetups string = '[]' @description('Access token for authenticating requests to GitHub.') diff --git a/server/main.json b/server/main.json index 27708f90..6e60946c 100644 --- a/server/main.json +++ b/server/main.json @@ -22,7 +22,7 @@ "type": "string", "defaultValue": "[[]", "metadata": { - "description": "JSON array string fo projects to setup. E.g. [{\"url\":\"https://dev.azure.com/tingle/dependabot\",\"token\":\"dummy\",\"AutoComplete\":true}]" + "description": "JSON array string for projects to setup. E.g. [{\"url\":\"https://dev.azure.com/tingle/dependabot\",\"token\":\"dummy\",\"AutoComplete\":true}]" } }, "githubToken": {