diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..cbbaf2f3 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.svg,i18n,*.lock,*.css,*.min.*,.codespellrc,packages,completion,assets,package.json +check-hidden = true +ignore-regex = \b[a-z]+[A-Z][A-Za-z]*\b +# ignore-words-list = diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..c59e0473 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +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: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/apps/vscode-editor/src/sync.ts b/apps/vscode-editor/src/sync.ts index 098dae45..d2eb6cd5 100644 --- a/apps/vscode-editor/src/sync.ts +++ b/apps/vscode-editor/src/sync.ts @@ -172,7 +172,7 @@ export async function syncEditorToHost( // apply initial theme applyDisplayPrefs(); - // init editor contents and sync cannonical version back to text editor + // init editor contents and sync canonical version back to text editor const result = await editor.setMarkdown(markdown, writerOptions(), false); if (result) { diff --git a/apps/vscode/CHANGELOG.md b/apps/vscode/CHANGELOG.md index cfce78e4..d2658416 100644 --- a/apps/vscode/CHANGELOG.md +++ b/apps/vscode/CHANGELOG.md @@ -56,7 +56,7 @@ - Enable snippet suggestions in qmd mode - Visual Editor: Preserve shortcodes in link targets - Correct config value for disabling word based suggestions -- Embedded syntax hightlighting and cell execution for Stata +- Embedded syntax highlighting and cell execution for Stata ## 1.109.0 (Release on 2023-12-07) @@ -297,7 +297,7 @@ - Exclude parens from cite/crossref highlighting in visual editor - Correct hover/preview behavior for display math in lists - Syntax highlighting for `plantuml` code blocks -- Remove custom paste hadling for links (too many unwanted side effects) +- Remove custom paste handling for links (too many unwanted side effects) - Only update Quarto Assist panel for Quarto docs - Visual mode select all in codeblock now targets just the code block - Correctly advance selection for line-by-line execution in visual mode @@ -544,7 +544,7 @@ - Respect `eval: false` for cell execution commands - LaTeX equation preview: include \newcommand (and similar) definitions in preview - Correct package.json configuration for quick suggestions -- Outline view: protect against unparseable YAML in title block +- Outline view: protect against unparsable YAML in title block ## 1.44.0 (Release on 2022-10-03) diff --git a/apps/vscode/languages/dot/snippets/dot.json b/apps/vscode/languages/dot/snippets/dot.json index 242e6801..23adb3a5 100644 --- a/apps/vscode/languages/dot/snippets/dot.json +++ b/apps/vscode/languages/dot/snippets/dot.json @@ -63,7 +63,7 @@ "{ rank=same|min|max; x; y }": { "prefix": "rank", "body": [ - "{ rank=${1|same,min,max,# max is bottom|}; ${2:space delimitted list }};" + "{ rank=${1|same,min,max,# max is bottom|}; ${2:space delimited list }};" ], "description": "{rank=same|min|max; x; y}" }, diff --git a/apps/vscode/package.json b/apps/vscode/package.json index 5aa0cd1f..7d42834c 100644 --- a/apps/vscode/package.json +++ b/apps/vscode/package.json @@ -1165,7 +1165,7 @@ "sentence" ], "markdownEnumDescriptions": [ - "Do not perform any text wraping", + "Do not perform any text wrapping", "Wrap text to occupy a fixed number of columns", "Insert a line break after each sentence" ] diff --git a/apps/vscode/src/host/hooks.ts b/apps/vscode/src/host/hooks.ts index 3b0b6965..96677b35 100644 --- a/apps/vscode/src/host/hooks.ts +++ b/apps/vscode/src/host/hooks.ts @@ -46,7 +46,7 @@ export function hasHooks() { export function hooksExtensionHost(): ExtensionHost { return { - // supported executable languages (we delegate to the default for langugaes + // supported executable languages (we delegate to the default for languages // w/o runtimes so we support all languages) executableLanguages, diff --git a/apps/vscode/src/lsp/client.ts b/apps/vscode/src/lsp/client.ts index 8d4f8d97..d7615ce6 100644 --- a/apps/vscode/src/lsp/client.ts +++ b/apps/vscode/src/lsp/client.ts @@ -178,7 +178,7 @@ function embeddedCodeCompletionProvider(engine: MarkdownEngine) { const vdoc = await virtualDoc(document, position, engine); if (vdoc && !isWithinYamlComment(document, position)) { - // if there is a trigger character make sure the langauge supports it + // if there is a trigger character make sure the language supports it const language = vdoc.language; if (context.triggerCharacter) { if ( diff --git a/apps/vscode/src/main.ts b/apps/vscode/src/main.ts index 51239b44..c219bdf8 100644 --- a/apps/vscode/src/main.ts +++ b/apps/vscode/src/main.ts @@ -99,7 +99,7 @@ export async function activate(context: vscode.ExtensionContext) { commands.push(...assistCommands); } - // walkthough + // walkthrough commands.push(...walkthroughCommands(host, quartoContext)); // provide render diff --git a/apps/vscode/src/providers/cell/commands.ts b/apps/vscode/src/providers/cell/commands.ts index 9fc942cc..a95b1d80 100644 --- a/apps/vscode/src/providers/cell/commands.ts +++ b/apps/vscode/src/providers/cell/commands.ts @@ -521,7 +521,7 @@ class RunCellsBelowCommand extends RunCommand implements Command { for (const blk of tokens.filter((token?: Token) => blockIsExecutable(this.host_, token)) as Array) { // skip if the cell is above or at the cursor if (line < blk.range.start.line) { - // set langauge if needed + // set language if needed const blockLanguage = languageNameFromBlock(blk); if (!language) { language = blockLanguage; diff --git a/apps/vscode/src/providers/create/directory.ts b/apps/vscode/src/providers/create/directory.ts index 6999489e..bf9d5ba9 100644 --- a/apps/vscode/src/providers/create/directory.ts +++ b/apps/vscode/src/providers/create/directory.ts @@ -25,7 +25,7 @@ export async function resolveDirectoryForCreate( subdirTitle: string, forceSubdirPrompt: boolean ) { - // select direcotry (see if we have a default parent) + // select directory (see if we have a default parent) const kDefaultParentDir = `quarto.create${name}.dir`; const defaultParent = context.globalState.get( kDefaultParentDir, diff --git a/apps/vscode/src/providers/diagram/diagram-webview.ts b/apps/vscode/src/providers/diagram/diagram-webview.ts index 5430dca1..9816154c 100644 --- a/apps/vscode/src/providers/diagram/diagram-webview.ts +++ b/apps/vscode/src/providers/diagram/diagram-webview.ts @@ -91,7 +91,7 @@ export class QuartoDiagramWebviewManager extends QuartoWebviewManager< private async updatePreview(state?: DiagramState) { if (this.isVisible()) { - // see if there is an explcit state update (otherwise inspect hte active editor) + // see if there is an explicit state update (otherwise inspect the active editor) if (state) { this.updateViewState(state); diff --git a/apps/vscode/src/providers/diagram/diagram.ts b/apps/vscode/src/providers/diagram/diagram.ts index 2bbc16fd..e7749883 100644 --- a/apps/vscode/src/providers/diagram/diagram.ts +++ b/apps/vscode/src/providers/diagram/diagram.ts @@ -32,7 +32,7 @@ export function activateDiagram( host: ExtensionHost, engine: MarkdownEngine ): Command[] { - // initiaize manager + // initialize manager const diagramManager = new QuartoDiagramWebviewManager(context, host, engine); // code lens diff --git a/apps/vscode/src/providers/editor/sync.ts b/apps/vscode/src/providers/editor/sync.ts index f34fa2c7..f6b1132a 100644 --- a/apps/vscode/src/providers/editor/sync.ts +++ b/apps/vscode/src/providers/editor/sync.ts @@ -66,8 +66,8 @@ export function editorSyncManager( ): EditorSyncManager { // state: an update from the visual editor that we have yet to apply. we don't - // apply these on every keystoke b/c they are expensive. we poll to apply these - // udpates periodically and also apply them immediately on save and when the + // apply these on every keystroke b/c they are expensive. we poll to apply these + // updates periodically and also apply them immediately on save and when the // visual editor instructs us to do so (e.g. when it loses focus) let pendingVisualEdit: unknown | undefined; @@ -76,7 +76,7 @@ export function editorSyncManager( let supressNextUpdate = false; // collect a pending edit, converting it to markdown and setting the supressNextUpdate bit - // if we fail get the markdown then we neither clear the pending edit nor supress the update + // if we fail get the markdown then we neither clear the pending edit nor suppress the update const collectPendingVisualEdit = async (): Promise => { if (pendingVisualEdit) { const state = pendingVisualEdit; @@ -135,7 +135,7 @@ export function editorSyncManager( } }, - // notification that the visual editor changed (enque the change) + // notification that the visual editor changed (enqueue the change) onVisualEditorChanged: async (state: unknown) => { pendingVisualEdit = state; }, @@ -144,7 +144,7 @@ export function editorSyncManager( flushPendingUpdates: collectAndApplyPendingVisualEdit, // notification that the document changed, let the visual editor - // know about the change unless the next update is supressed. note that + // know about the change unless the next update is suppressed. note that // the visual editor will throttle these changes internally (and // apply them immediately when it receives focus) onDocumentChanged: async () => { @@ -155,7 +155,7 @@ export function editorSyncManager( } }, - // notification that we are saving (allow flusing of visual editor changes) + // notification that we are saving (allow flushing of visual editor changes) onDocumentSaving: async (): Promise => { // attempt to collect pending edit const markdown = await collectPendingVisualEdit(); diff --git a/apps/vscode/src/providers/editor/toggle.ts b/apps/vscode/src/providers/editor/toggle.ts index 6fb88349..440b8b31 100644 --- a/apps/vscode/src/providers/editor/toggle.ts +++ b/apps/vscode/src/providers/editor/toggle.ts @@ -128,7 +128,7 @@ export async function reopenEditorInSourceMode( VisualEditorProvider.recordPendingSwitchToSource(document); // close editor (return immediately as if we don't then any - // rpc method that calls this wil result in an error b/c the webview + // rpc method that calls this will result in an error b/c the webview // has been torn down by the time we return) commands.executeCommand('workbench.action.closeActiveEditor').then(async () => { if (document.isUntitled) { diff --git a/apps/vscode/src/providers/option.ts b/apps/vscode/src/providers/option.ts index f49ee145..32335087 100644 --- a/apps/vscode/src/providers/option.ts +++ b/apps/vscode/src/providers/option.ts @@ -52,7 +52,7 @@ export function activateOptionEnterProvider( ); if (block) { const language = languageNameFromBlock(block); - // handle option enter for the this langauge if we can + // handle option enter for the this language if we can const optionComment = languageOptionComment(language); if (optionComment) { handleOptionEnter(window.activeTextEditor, optionComment); @@ -89,14 +89,14 @@ function handleOptionEnter(editor: TextEditor, comment: string) { } } -function languageOptionComment(langauge: string) { +function languageOptionComment(language: string) { // some mappings - if (langauge === "ojs") { - langauge = "js"; + if (language === "ojs") { + language = "js"; } - if (Object.keys(kLangCommentChars).includes(langauge)) { - return kLangCommentChars[langauge]; + if (Object.keys(kLangCommentChars).includes(language)) { + return kLangCommentChars[language]; } else { return undefined; } diff --git a/apps/vscode/src/providers/preview/preview-errors.ts b/apps/vscode/src/providers/preview/preview-errors.ts index 4e48dccb..b391a97f 100644 --- a/apps/vscode/src/providers/preview/preview-errors.ts +++ b/apps/vscode/src/providers/preview/preview-errors.ts @@ -73,7 +73,7 @@ export function jupyterErrorLocation( /An error occurred while executing the following cell:\s+(-{3,})\s+([\S\s]+?)\r?\n(\1)[\S\s]+line (\d+)\)/; const jupyterMatch = output.match(jupyterPattern); if (jupyterMatch) { - // read target file and searh for the match (normalized) + // read target file and search for the match (normalized) if (fs.statSync(previewTarget).isFile()) { const cellSrc = jupyterMatch[2]; const previewSrc = normalizeNewlines( diff --git a/apps/vscode/src/providers/preview/preview.ts b/apps/vscode/src/providers/preview/preview.ts index 5c8d93ea..800d343d 100644 --- a/apps/vscode/src/providers/preview/preview.ts +++ b/apps/vscode/src/providers/preview/preview.ts @@ -533,7 +533,7 @@ class PreviewManager { ); if (browseMatch) { // earlier versions of quarto serve didn't print out vscode urls - // correctly so we compenstate for that here + // correctly so we compensate for that here if (isQuartoShinyDoc(this.engine_, this.previewDoc_)) { this.previewUrl_ = vsCodeWebUrl(browseMatch[2]); } else { diff --git a/apps/vscode/src/vdoc/languages.ts b/apps/vscode/src/vdoc/languages.ts index b2e76c0c..dbce368b 100644 --- a/apps/vscode/src/vdoc/languages.ts +++ b/apps/vscode/src/vdoc/languages.ts @@ -28,9 +28,9 @@ export interface EmbeddedLanguage { canFormatDocument?: boolean; } -export function embeddedLanguage(langauge: string) { - langauge = langauge.split("-").pop() || ""; - return kEmbededLanguages.find((lang) => lang.ids.includes(langauge)); +export function embeddedLanguage(language: string) { + language = language.split("-").pop() || ""; + return kEmbededLanguages.find((lang) => lang.ids.includes(language)); } export function languageCanFormatDocument(language: EmbeddedLanguage) { @@ -38,7 +38,7 @@ export function languageCanFormatDocument(language: EmbeddedLanguage) { } const kEmbededLanguages = [ - // these langauges required creating a temp file + // these languages required creating a temp file defineLanguage("python", { inject: ["# type: ignore", "# flake8: noqa"], emptyLine: "#", @@ -77,7 +77,7 @@ const kEmbededLanguages = [ defineLanguage("java"), defineLanguage("cpp"), defineLanguage("go"), - // these langauges work w/ text document content provider + // these languages work w/ text document content provider defineLanguage("html", { type: "content" }), defineLanguage("css", { type: "content" }), defineLanguage("javascript", { type: "content" }), @@ -98,7 +98,7 @@ function defineLanguage( options?: LanguageOptions ): EmbeddedLanguage { - // lookup langauge + // lookup language const language = editorLanguage(id); if (!language) { throw new Error(`Unknown language ${id}`); diff --git a/apps/writer-server/src/index.ts b/apps/writer-server/src/index.ts index 67125b29..499cd5ec 100644 --- a/apps/writer-server/src/index.ts +++ b/apps/writer-server/src/index.ts @@ -24,7 +24,7 @@ import { createServer } from './server'; const development = process.env.NODE_ENV !== 'production'; // resource dirs -// TODO: we currnetly don't copy resources from quarto-core +// TODO: we currently don't copy resources from quarto-core const cwd = process.cwd(); const editorDevResourcesDir = path.normalize(path.join(cwd, "../../packages/editor-server/src/resources")); const editorResourcesDir = development ? editorDevResourcesDir : editorDevResourcesDir; diff --git a/apps/writer/public/content/MANUAL-FULL.md b/apps/writer/public/content/MANUAL-FULL.md index 3f642bfe..f9eec408 100644 --- a/apps/writer/public/content/MANUAL-FULL.md +++ b/apps/writer/public/content/MANUAL-FULL.md @@ -949,7 +949,7 @@ header when requesting a document from a URL: `--no-check-certificate` : Disable the certificate verification to allow access to - unsecure HTTP resources (for example when the certificate + insecure HTTP resources (for example when the certificate is no longer valid or self signed). ## Options affecting specific writers {.options}