excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.82k stars 188 forks source link

Find a way to spell check comments on build #573

Closed eonarheim closed 2 years ago

eonarheim commented 8 years ago

Context

It would be very helpful and efficient to be able to automatically check the spelling of comments in order to increase the quality of the Excalibur documentation.

Proposal

Automatically spellcheck comments as part of the build process.

alanag13 commented 8 years ago

check out http://www.afterthedeadline.com/api.slp.

a post to service.afterthedeadline.com/checkDocument with key = literally any unique value (this is supposedly just used for server side caching) and data = your string will produce xml suggestions of replacement words. HTML is automatically stripped from your string.

for example, a post i did with "spel wrong intenonaly" as the document produced the following XML:

    <error>
        <string>spel</string>
        <description>Spelling</description>
        <precontext></precontext>
        <suggestions>
            <option>spelt</option>
            <option>spell</option>
            <option>sped</option>
            <option>spec</option>
            <option>spew</option>
        </suggestions>
        <type>spelling</type>
    </error>
    <error>
        <string>intenonaly</string>
        <description>Spelling</description>
        <precontext>wrong</precontext>
        <suggestions>
            <option>intently</option>
            <option>internally</option>
            <option>internal</option>
            <option>intentional</option>
            <option>intentionally</option>

        </suggestions>
        <type>spelling</type> 
    </error>
</results>
kritisingh1 commented 7 years ago

@eonarheim if this issue is open, I would like to work on it. I am a beginner and this would be my first contribution to open source.

kamranayub commented 7 years ago

You could try, I imagine this will be a bit of work. There's a VS Code plugin called Spell Right that I use that intelligently does spell checking in comments or strings and ignores code. It might be good to look at their source code to see how they do it (may be using Code APIs) or look at TS or JS spell check plugins if they exist that we can integrate.

On Tue, Jun 6, 2017, 06:43 Kriti Singh notifications@github.com wrote:

@eonarheim https://github.com/eonarheim if this issue is open, I would like to work on it. I am a beginner and this would be my first contribution to open source.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/excaliburjs/Excalibur/issues/573#issuecomment-306461399, or mute the thread https://github.com/notifications/unsubscribe-auth/AAiaa_B5SWjMZy0hcGPBMsC89QtlB5WFks5sBTt-gaJpZM4HU6cD .

AndrewCraswell commented 3 years ago

ESLint has a Spellcheck plugin that I've used to scan our code. Can be toggled to search just comments if I recall. Not sure how this would scale to localized versions though, since code is assumed to always be in a single (usually english) language.

https://github.com/aotaduy/eslint-plugin-spellcheck

eonarheim commented 2 years ago

We've been using this extension during development time https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker

Closing to clean up backlog, we may revisit in the future