Git Product home page Git Product logo

danger-plugin-spellcheck's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

danger-plugin-spellcheck's Issues

Other languages support

Hi guys,

First of all, congrats, that’s a great plugin.

I’m brazilian and we, brazilians, speak Portuguese. I tried to use this plugin on my codebase (which has a lot of Portuguese phrases) and danger was detecting it as miss spell words.

I saw that you use cspell under the hood. Is that any support for other languages rather than English?

Regex support for ignored words

screen shot 2017-08-30 at 12 55 42

"Heroku-like", "2.x" and "started.md" are false positives we definitely cover via word matching, but they can be caught easily via regex.

Gitlab support

Currently, this project does not seem to support Gitlab, due to the Github references in the code.
This leads to the following error:

Error:  TypeError: Cannot read property 'thisPR' of 
    at getPRParams (/builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:44:62)
    at Object.<anonymous> (/builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:93:20)
    at Generator.next (<anonymous>)
    at /builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:3:12)
    at Object.exports.getSpellcheckSettings (/builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:82:46)
    at /builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:112:40
    at Generator.next (<anonymous>)
    at /builds/livio.brunner.lb1/stranger-danger/node_modules/danger-plugin-spellcheck/dist/index.js:7:71

Process Hangs

Trying to implement danger spellcheck.

dangerfile.ts

import { schedule } from 'danger'
import spellcheck from 'danger-plugin-spellcheck'

// let's spellcheck
schedule(spellcheck())

spellcheck.json

{
  "ignore": ["orta", "artsy", "github", "/danger-*."],
  "whitelistFiles": ["README.md"]
}

result is hung process

$ yarn danger -d dangerfile.ts
yarn run v1.3.2
$ /home/travis/build/infinitered/solidarity/node_modules/.bin/danger -d dangerfile.ts
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

See it all here:

https://travis-ci.org/infinitered/solidarity/jobs/322670405

specs:

node module version
"danger" "^2.1.8"
"danger-plugin-spellcheck" "^1.2.0",

Issues with TS/JS imports

πŸ‘‹ Hiya

First time with Danger JS, been working with it today.

Found 2 issues, which I have solutions for, they both might return to master as PRs, but I'm apparently stumped with my latest issue.

Empty Dangerfile does a simple import

import { schedule } from 'danger'
// import spellcheck from 'danger-plugin-spellcheck'

// let's spellcheck
// schedule(spellcheck())

image
YAY! πŸŽ‰

Uncomment import for spellcheck now

import { schedule } from 'danger'
import spellcheck from 'danger-plugin-spellcheck'

// let's spellcheck
// schedule(spellcheck())

image
❌ Failing import

Unexpected token import??? But but... we import on line 1 just fine.
If I switch this to a require it will work, but the resulting const will not be a function.

What am I doing wrong?

Allow spellcheck properties via spellcheck command

Having a JSON file for the spellcheck is cool. Ideally, I would like to be able to append settings from my dangerfile.js so I could add ignore words from various places. I already have a spellchecked list of words for my editor, and it would be great to include that.

I'd be willing to take on this PR.

What's needed, is that we'd be able to add ignore and whitelist to the options of the spellcheck function. These would be merged by the spellcheck. Would you accept something like this?

Add an implicit per-project spell check settings

This needs to be thought of from the perspective of Peril.

Peril for Artsy runs spellcheck on every repo. So there is a global settings file for all spellchecking referenced at launch.

Ideally we want to be able to merge that settings object with a per-repo object. So here's how I could imagine it to work:

  • Today this plugin downloads the global settings and merges them into the settings

  • Straight after this, there is a check for a file called spellcheck.json inside the repo (on the right branch) ( const perRepoContents = await getFileContents("spellcheck.json", getPRParams(file)) )

  • These changes are then merged in with the existing settings - giving the change to add new whitelistedMarkdowns files, and new words to the ignoredWords section

Global edit URL hardcodes master

This seems to be the offending line:

const globalEditURL = repo && `/${repo.owner}/${repo.repo}/edit/master/${repo.path}`

I wouldn't have expected this to be an actual problem, except when I followed the link from microsoft/TypeScript-Website#1320 (comment) I got a 404 page.

Oh! It's a problem in that instance because there really is still a master branch lying around. Perhaps it ought to be renamed v1 ... still, might be a good idea to come up with a way for this plugin to actually link to the correct branch?

Spellcheck JSON not being legit should be caught

Unexpected string in JSON at position 3058
SyntaxError: Unexpected string in JSON at position 3058
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (/app/node_modules/danger-plugin-spellcheck/dist/index.js:51:31)
    at Generator.next (<anonymous>)
    at fulfilled (/app/node_modules/danger-plugin-spellcheck/dist/index.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Spellcheck only running on certain files

I've got danger and danger-plugin-spellcheck running through CircleCI and it is now able to post comments when there are errors in the README.md.

It doesn't seem to be analyzing anything in my openapi.yml file though, which is the main file I want checked.

I noticed there's a whitelistFiles option, but that's to ignore certain files.
What can you do to specifically add a file to be evaluated?
Do you support yaml files?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.