Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support file types from CLI args #11

Closed
wants to merge 10 commits into from
Closed

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Oct 16, 2023

PR Feedback: 👎

Description

This PR adds support for specifying file types from the command line interface (CLI) in the cspell-tool. Previously, the tool only supported a fixed set of file types (md, ts, json, lua). With this change, users can now specify the file types they want to check for spelling issues when running the tool.

Additionally, this PR introduces the use of the consola library to prompt the user for input. The same approach used in the consola library example provided by the user is implemented to prompt the user for the file types they want to check.

Summary of Changes

  • Modified src/index.ts to import the consola library and use it to prompt the user for file types to check.
  • Updated the cmd variable in src/index.ts to use the file types specified by the user when constructing the command to run cspell.
  • Added consola as a dependency in package.json to enable the use of the consola library for prompting the user.

Please review and merge this PR to enable the cspell-tool to support custom file types from the CLI.

Fixes #5.


🎉 Latest improvements to Sweep:

  • Sweep can now passively improve your repository! Check out Rules to learn more.

💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Oct 16, 2023

Rollback Files For Sweep

  • Rollback changes to src/index.ts

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Oct 16, 2023

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Code should be properly formatted and indented.
  • Apply: Variable and function names should be descriptive and follow a consistent naming convention.
  • Apply: There should be no unused imports or variables.
  • Apply: There should be no hard-coded values or magic numbers in the code.

@sweep-ai sweep-ai bot added the sweep label Oct 16, 2023
@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2023

⚠️ No Changeset found

Latest commit: 62c993c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sweep-ai sweep-ai bot mentioned this pull request Oct 16, 2023
2 tasks
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@jellydn
Copy link
Owner

jellydn commented Oct 17, 2023

Let's fix the linter issue https://github.com/jellydn/cspell-tool/actions/runs/6540243952/job/17759818576?pr=11

$ eslint --ext .ts .

/home/runner/work/cspell-tool/cspell-tool/src/index.ts
  [6](https://github.com/jellydn/cspell-tool/actions/runs/6540243952/job/17759818576?pr=11#step:5:7)4:34  error  'fileType' will evaluate to '[object Object]' when stringified                   @typescript-eslint/no-base-to-string
  64:34  error  Invalid type "{ value: string; label: string; }" of template literal expression  @typescript-eslint/restrict-template-expressions

✖ 2 problems (2 errors, 0 warnings)

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Oct 17, 2023

🚀 Wrote Changes

Done.

src/index.ts Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
@jellydn
Copy link
Owner

jellydn commented Oct 17, 2023

Let's fix linter issue https://github.com/jellydn/cspell-tool/actions/runs/6547644743/job/17780545802?pr=11

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Oct 17, 2023

🚀 Wrote Changes

I wasn't able to make changes. This could be due to an unclear request or a bug in my code.
As a reminder, comments on a file only modify that file. Comments on a PR(at the bottom of the "conversation" tab) can modify the entire PR. Please try again or contact us on Discord

@jellydn jellydn closed this Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Support file types from CLI args
1 participant