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

Feature: Have cspell automatically detect values from the package #381

Closed
3 tasks done
orta opened this issue Apr 23, 2023 · 7 comments · Fixed by #1794
Closed
3 tasks done

Feature: Have cspell automatically detect values from the package #381

orta opened this issue Apr 23, 2023 · 7 comments · Fixed by #1794
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@orta
Copy link
Contributor

orta commented Apr 23, 2023

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Let's say I have made a module call "sdl-codegen"- when you run setup things like your username, the npm org, any words in the kebab case package name etc

Mainly so there's less surprises when you try get it green for the first time

Additional Info

@orta orta added the type: feature New enhancement or request label Apr 23, 2023
@JoshuaKGoldberg
Copy link
Owner

Yeah it's been annoying having to fill out assorted package names & such in each new package 😕. I want to say this is blocked on streetsidesoftware/cspell#3215. Do you see any way around it @orta?

@JoshuaKGoldberg JoshuaKGoldberg added the status: blocked Waiting for something else to be resolved label Apr 23, 2023
@orta
Copy link
Contributor Author

orta commented Apr 24, 2023

Add it to the cspell file in the repo, that's how I solved it locally

@navin-moorthy
Copy link
Contributor

navin-moorthy commented Jun 10, 2023

I use cspell paired with a custom script to populate the false positive in a separate file as new dictionary.

Script - https://github.com/timelessco/node-ts-app/blob/main/package.json#L46
Custom dictionary file - https://github.com/timelessco/node-ts-app/blob/main/project-words.txt
Dictionary file added to the cspell config - https://github.com/timelessco/node-ts-app/blob/main/cspell.json#L22

@JoshuaKGoldberg JoshuaKGoldberg changed the title Feature: Add a bunch of possible words to the cspell dict Feature: Have cspell automatically detect values from the package Aug 25, 2023
@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! and removed status: blocked Waiting for something else to be resolved labels Dec 21, 2024
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Dec 21, 2024
@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Dec 21, 2024

OK! Coming back to this: I've learned a good bit about cspell in the meantime and thought on the issue. I think it's different depending on how you're running CTA:

  • "Creation" and "Initialization" modes: this issue absolutely applies. No words in your provided options -description, title, logo alt, etc.- should be reported. Anything that would be should be added to your cspell words.
  • "Migration" mode: the exemptions for options still apply, but not for the rest of the repo. If you have existing typos then they should be reported.

https://github.com/JoshuaKGoldberg/cspell-populate-words is my own script that adds in missing words. It's got references of using the cspell API. I'll integrate some amount of those bits into CTA.

@JoshuaKGoldberg
Copy link
Owner

@all-contributors please add @orta for ideas.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Copy link
Contributor

@JoshuaKGoldberg

I've put up a pull request to add @orta! 🎉

JoshuaKGoldberg pushed a commit that referenced this issue Dec 21, 2024
Adds @orta as a contributor for ideas.

This was requested by JoshuaKGoldberg [in this
comment](#381 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Dec 21, 2024

Hmm, this is tough. The main cspell APIs are all generally asynchronous. I'm poking around in the internal checkText -> checkTextDocument -> DocumentValidator::prepare() and there's a lot of async work to read in dictionaries and such. This will need to be asynchronous.

The only way to do that in the new Blocks system is with a scripts entry. I'll have that be the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants