uribo / textlintr

✅ Natural Language Linter Tools for 'R Markdown' and R Code 💯
https://uribo.github.io/textlintr/
Other
8 stars 1 forks source link

`.textlintrc` changed unintentionally. #17

Closed uribo closed 5 years ago

uribo commented 5 years ago

.textlintrcのなかにルールをネストで記述するものがある場合、update_lint_rules()でルールを追加後にエラーが起こる。

library(textlintr)

writeLines("Rmarkdown", "sample.md")
textlint("sample.md", markers = FALSE)
# 1 inputs ✔ | 0 warnings ✔
# Great! There is no place to modify.

update_lint_rules("no-todo") # Add a rule
textlint("sample.md", markers = FALSE)
# Error: parse error: premature EOF
# 
# (right here) ------^

元の.textlintrc

{
  "rules": {
    "common-misspellings": true,
    "prh": {
      "rulePaths": ["/home/rstudio/argama/inst/prh/r.yml"]
    }
  },
  "plugins": {
    "@textlint/markdown": {
      "extensions": ".Rmd"
    }
  }
}

update_lint_rules()適用後

{
  "rules": {
    "common-misspellings": true,
    "prh": {
      "rulePaths": "/home/rstudio/argama/inst/prh/r.yml"
    },
    "no-todo": true
  },
  "plugins": {
    "@textlint/markdown": {
      "extensions": ".Rmd"
    }
  }
}

boxが外れてしまうのが問題っぽい。