Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Some videos related to CodeTypo and the [Code Spell Checker](https://marketplace

## Related Packages

- [codetypo-cli](https://github.com/khulnasoft/codetypo-cli) -- `codetypo-cli` is useful for including `codetypo` directly from GitHub.
- [codetypo-cli](https://github.com/khulnasoft/codetypo) -- `codetypo-cli` is useful for including `codetypo` directly from GitHub.

Example install: `npm install -g git+https://github.com/khulnasoft/codetypo-cli`.
Example install: `npm install -g git+https://github.com/khulnasoft/codetypo`.

This will add the `codetypo-cli` command, which is an alias of the `codetypo` command.

Expand Down
2 changes: 1 addition & 1 deletion codetypo.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ words:
- pipefail
- prebuilds
- Réforme
- streetsidesoftware
- khulnasoft
- Sublicensing
- tidelift
- WIPO
Expand Down
Binary file modified docs/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/_includes/generated-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Some videos related to CodeTypo and the [Code Spell Checker](https://marketplace

## Related Packages

- [codetypo-cli](https://github.com/khulnasoft/codetypo-cli) -- `codetypo-cli` is useful for including `codetypo` directly from GitHub.
- [codetypo-cli](https://github.com/khulnasoft/codetypo) -- `codetypo-cli` is useful for including `codetypo` directly from GitHub.

Example install: `npm install -g git+https://github.com/khulnasoft/codetypo-cli`.
Example install: `npm install -g git+https://github.com/khulnasoft/codetypo`.

This will add the `codetypo-cli` command, which is an alias of the `codetypo` command.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"conditional-build": "pnpm build:conditional",
"check-dirty": "git --no-pager diff --compact-summary --exit-code",
"checksum": "pnpm -r run checksum",
"create-dictionary": "node ./generator-cspell-dicts/run.js",
"create-dictionary": "node ./generator-codetypo-dicts/run.js",
"#update-dictionaries": "# Update dictionaries will run the update-dictionary script in each dictionary package.",
"update-dictionaries": "pnpm -r run --stream --workspace-concurrency 2 update-dictionary",
"update:contributors": "update-contributors $(gh auth token)",,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix JSON syntax error causing pipeline failures.

There is an extra comma after "update:contributors" script that is causing JSON syntax errors and pipeline failures.

Apply this diff to fix the syntax error:

-    "update:contributors": "update-contributors $(gh auth token)",,
+    "update:contributors": "update-contributors $(gh auth token)",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"update:contributors": "update-contributors $(gh auth token)",,
"update:contributors": "update-contributors $(gh auth token)",
🧰 Tools
🪛 Biome (1.9.4)

[error] 28-28: Expected a property but instead found ','.

Expected a property here.

(parse)

🪛 GitHub Actions: Website - Build and Test

[error] JSON syntax error: Expected double-quoted property name at position 1612. Property names in JSON must be enclosed in double quotes.

🪛 GitHub Actions: codeTypo-cli

[error] Invalid package.json file structure detected. The file appears to be malformed or contains invalid JSON syntax.

🪛 GitHub Actions: Lint Docs

[error] JSON syntax error: Expected double-quoted property name at position 1612. Property names in JSON must be enclosed in double quotes.

🪛 GitHub Actions: Test - Build Docs

[error] JSON syntax error: Expected double-quoted property name at position 1612. Property names in JSON must be enclosed in double quotes.

🪛 GitHub Actions: Website - Lint

[error] JSON syntax error: Expected double-quoted property name at position 1612. Property names in JSON must be enclosed in double quotes.

🪛 GitHub Actions: Lint

[error] JSON syntax error: Expected double-quoted property name at position 1612. Ensure all property names in the JSON file are enclosed in double quotes.

🪛 GitHub Actions: 🧪 Test

[error] JSON syntax error: Expected double-quoted property name at position 1612. Ensure all property names in the JSON file are enclosed in double quotes.

Expand Down
Binary file modified packages/.DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions packages/cli/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.CRLF.txt]
end_of_line = crlf

[*.noEOL.txt]
insert_final_newline = false

[*.{yaml,yml}]
indent_size = 2

[*.{json,jsonc}]
indent_size = 2

[*.md]
indent_size = 2
trim_trailing_whitespace = false
15 changes: 15 additions & 0 deletions packages/cli/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

patreon: khulnasoft
tidelift: "npm/codetypo"
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
- khulnasoft
open_collective: codetypo
# ko_fi: # Replace with a single Ko-fi username
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

# codetypo:ignore issuehunt
24 changes: 24 additions & 0 deletions packages/cli/.github/actions/github-app-token/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: github_app_token
description: Create a token for making Pull Requests

# Note: this just calls tibdex/github-app-token, but it allows us to keep it in one place.

inputs:
app_id:
description: Application ID used to make the PR
required: true
app_private_key:
description: Application Private Key used to sign the PR
required: true
outputs:
token:
description: A token for making Pull Requests
value: ${{ steps.generate-token.outputs.token }}
runs:
using: "composite"
steps:
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v1.5 # codetypo:ignore tibdex
id: generate-token
with:
app_id: ${{ inputs.app_id }}
private_key: ${{ inputs.app_private_key }}
68 changes: 68 additions & 0 deletions packages/cli/.github/actions/pr/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: create_pr
description: Create A Pull Request That will Trigger Workflows
inputs:
base:
description: The Base Ref to apply the diff
required: false
body:
description: Optional body of the PR
required: false
commit-message:
description: Commit Message for the PR
required: true
branch:
description: The Branch to create for the PR
required: true
title:
description: PR title - defaults to commit-message
required: false
app_id:
description: Application ID used to make the PR
required: true
app_private_key:
description: Application Private Key used to sign the PR
required: true
runs:
using: "composite"
steps:
- name: Has changes
shell: bash
run: |
git --no-pager diff --compact-summary --exit-code && echo "git_status=clean" >> $GITHUB_ENV || echo "git_status=dirty" >> $GITHUB_ENV
git --no-pager diff --compact-summary
- name: Gen Body
shell: bash
env:
BODY: ${{ inputs.body }}
run: |
echo 'git_body<<DIFF' >> $GITHUB_ENV
echo "$BODY" >> $GITHUB_ENV
git --no-pager diff --compact-summary >> $GITHUB_ENV
echo 'DIFF' >> $GITHUB_ENV
- name: Echo git_status
shell: bash
run: echo "${{ env.git_status }}"

- name: Body
shell: bash
run: |
echo "$git_body"

- uses: ./.github/actions/github-app-token
if: env.git_status == 'dirty'
id: generate-token
with:
app_id: ${{ inputs.app_id }}
app_private_key: ${{ inputs.app_private_key }}

Comment on lines +51 to +57

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for token generation.

The token generation step should include error handling to gracefully handle failures.

   - uses: ./.github/actions/github-app-token
     if: env.git_status == 'dirty'
     id: generate-token
+    continue-on-error: true
     with:
       app_id: ${{ inputs.app_id }}
       app_private_key: ${{ inputs.app_private_key }}
+   - name: Check Token Generation
+     if: env.git_status == 'dirty' && steps.generate-token.outcome == 'failure'
+     shell: bash
+     run: |
+       echo "::error::Failed to generate GitHub App token"
+       exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: ./.github/actions/github-app-token
if: env.git_status == 'dirty'
id: generate-token
with:
app_id: ${{ inputs.app_id }}
app_private_key: ${{ inputs.app_private_key }}
- uses: ./.github/actions/github-app-token
if: env.git_status == 'dirty'
id: generate-token
continue-on-error: true
with:
app_id: ${{ inputs.app_id }}
app_private_key: ${{ inputs.app_private_key }}
- name: Check Token Generation
if: env.git_status == 'dirty' && steps.generate-token.outcome == 'failure'
shell: bash
run: |
echo "::error::Failed to generate GitHub App token"
exit 1

- name: Create Pull Request
if: env.git_status == 'dirty'
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v4
with:
commit-message: ${{ inputs.commit-message }}
branch: ${{ inputs.branch }}
base: ${{ inputs.base }}
title: ${{ inputs.title || inputs.commit-message }}
token: ${{ steps.generate-token.outputs.token }}
body: ${{ env.git_body }}
delete-branch: true
19 changes: 19 additions & 0 deletions packages/cli/.github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: setup_node
description: Setup Node, and install Npm
inputs:
node-version:
required: false
description: The version of Node to use.
default: "18.x"
runs:
using: "composite"
steps:
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: ${{ inputs.node-version }}
cache: "npm"
- name: NPM Version
run: npm -v;
shell: bash
56 changes: 56 additions & 0 deletions packages/cli/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
target-branch: "codetypo4"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
target-branch: "codetypo4"
schedule:
interval: "daily"

# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/setup
schedule:
interval: daily
commit-message:
prefix: ci

# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/pr
schedule:
interval: daily
commit-message:
prefix: ci

# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/github-app-token
schedule:
interval: daily
commit-message:
prefix: ci
Comment on lines +34 to +56

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add version constraints for security

Consider adding version constraints to limit the scope of automated updates for security-sensitive actions.

   - package-ecosystem: github-actions
     directory: /.github/actions/setup
     schedule:
       interval: daily
     commit-message:
       prefix: ci
+    version-requirement-updates: increase-if-necessary
+    allow:
+      - dependency-type: direct
+    ignore:
+      - dependency-name: "*"
+        update-types: ["version-update:semver-major"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/setup
schedule:
interval: daily
commit-message:
prefix: ci
# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/pr
schedule:
interval: daily
commit-message:
prefix: ci
# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/github-app-token
schedule:
interval: daily
commit-message:
prefix: ci
# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/setup
schedule:
interval: daily
commit-message:
prefix: ci
version-requirement-updates: increase-if-necessary
allow:
- dependency-type: direct
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/pr
schedule:
interval: daily
commit-message:
prefix: ci
# Automatically added by khulnasoft/public/update-dependabot-github-actions
- package-ecosystem: github-actions
directory: /.github/actions/github-app-token
schedule:
interval: daily
commit-message:
prefix: ci

23 changes: 23 additions & 0 deletions packages/cli/.github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .github/release.yml

changelog:
exclude:
categories:
- title: Breaking Changes
labels:
- Semver-Major
- breaking
- title: Features
labels:
- Semver-Minor
- feature
- title: Fixes
labels:
- fix
- dev
- title: Other Changes
labels:
- "*"
- title: Maintenance
labels:
- chore
34 changes: 34 additions & 0 deletions packages/cli/.github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "CodeQL"

on:
push:
branches:
- main
- codetypo4
pull_request:
branches:
- main
- codetypo4
workflow_dispatch:
schedule:
- cron: "0 23 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Make sure it goes back far enough to find where the branch split from main
fetch-depth: 20

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "javascript"
Comment on lines +28 to +31

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider adding TypeScript language support

Since this is a TypeScript-related PR (based on the PR title "Typescripts"), consider adding TypeScript to the languages analyzed.

   with:
-    languages: "javascript"
+    languages: "javascript,typescript"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "javascript"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "javascript,typescript"


- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
18 changes: 18 additions & 0 deletions packages/cli/.github/workflows/cspell-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: codetypo-action
on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
codetypo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: khulnasoft/codetypo-action@v6
Comment on lines +13 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Pin the action versions to SHA for security.

Using version tags for actions can be a security risk. Consider pinning to specific commit SHAs.

-      - uses: actions/checkout@v4
-      - uses: khulnasoft/codetypo-action@v6
+      - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
+      - uses: khulnasoft/codetypo-action@5c2a8e2c7c0d32d51425b72d5224c0eb8326d664 # v6
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v4
- uses: khulnasoft/codetypo-action@v6
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: khulnasoft/codetypo-action@5c2a8e2c7c0d32d51425b72d5224c0eb8326d664 # v6

with:
files: "."
incremental_files_only: false
check_dot_files: true
Loading