diff --git a/.Rbuildignore b/.Rbuildignore index 83ecf11..0263c24 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,3 +10,6 @@ languages_by_source.xlsx ^CNAME$ ^_pkgdown\.yml$ ^css/ +^images/ +^pkgdown/ +^\.lintr$ diff --git a/.lintr b/.lintr new file mode 100644 index 0000000..95024ac --- /dev/null +++ b/.lintr @@ -0,0 +1,4 @@ +linters: with_defaults( + line_length_linter(100), + NULL + ) diff --git a/.travis.yml b/.travis.yml index aa918dd..41b24ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,9 @@ language: R sudo: false cache: packages +env: + global: + - LINTR_COMMENT_BOT=false + after_success: - Rscript -e 'covr::codecov()' diff --git a/DESCRIPTION b/DESCRIPTION index e057861..212f240 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: stopwords Type: Package Title: Multilingual Stopword Lists -Version: 0.9.0 +Version: 0.9.9000 Authors@R: c(person("Kenneth", "Benoit", email = "kbenoit@lse.ac.uk", role = "aut"), person("David", "Muhr", email = "muhrdavid+github@gmail.com", role = c("aut", "cre")), person("Kohei", "Watanabe", email = "watanabe.kohei@gmail.com", role = "aut")) @@ -12,12 +12,15 @@ Depends: Imports: ISOcodes Suggests: + covr, + lintr, quanteda, - testthat, - covr + spelling, + testthat URL: https://github.com/davnn/stopwords BugReports: https://github.com/davnn/stopwords/issues Encoding: UTF-8 LazyData: true +Language: en-GB Roxygen: list(markdown = TRUE) -RoxygenNote: 6.0.1 +RoxygenNote: 6.1.1 diff --git a/README.Rmd b/README.Rmd index b05196f..c880e0a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,7 +13,7 @@ knitr::opts_chunk$set( # stopwords: the R package [![CRAN Version](https://www.r-pkg.org/badges/version/stopwords)](https://CRAN.R-project.org/package=stopwords) -[![Travis-CI Build Status](https://travis-ci.org/davnn/stopwords.svg?branch=master)](https://travis-ci.org/davnn/stopwords) +[![Travis-CI Build Status](https://travis-ci.org/quanteda/stopwords.svg?branch=master)](https://travis-ci.org/quanteda/stopwords) [![Coverage status](https://codecov.io/gh/davnn/stopwords/branch/master/graph/badge.svg)](https://codecov.io/github/davnn/stopwords?branch=master) [![Downloads](https://cranlogs.r-pkg.org/badges/stopwords)](https://CRAN.R-project.org/package=stopwords) [![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/stopwords?color=orange)](https://CRAN.R-project.org/package=stopwords) diff --git a/README.md b/README.md index 475ae31..cf7dd98 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![CRAN Version](https://www.r-pkg.org/badges/version/stopwords)](https://CRAN.R-project.org/package=stopwords) [![Travis-CI Build -Status](https://travis-ci.org/davnn/stopwords.svg?branch=master)](https://travis-ci.org/davnn/stopwords) +Status](https://travis-ci.org/quanteda/stopwords.svg?branch=master)](https://travis-ci.org/quanteda/stopwords) [![Coverage status](https://codecov.io/gh/davnn/stopwords/branch/master/graph/badge.svg)](https://codecov.io/github/davnn/stopwords?branch=master) [![Downloads](https://cranlogs.r-pkg.org/badges/stopwords)](https://CRAN.R-project.org/package=stopwords) diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..09c149d --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,52 @@ +af +ar +bg +Bhogayata +bn +br +Chandrakant +com +cs +el +eo +es +eu +fi +ga +github +gl +gu +Hausa +hr +hu +hy +iso +ja +ko +ku +lt +lv +mr +nl +NLP +pl +Rcv +ro +ru +Schwemmer +sk +sl +st +stemmer +stemmer's +stopword +Stopword +sv +sw +th +tl +tr +uk +ur +zh +zu diff --git a/tests/lint.R b/tests/lint.R new file mode 100644 index 0000000..03711dc --- /dev/null +++ b/tests/lint.R @@ -0,0 +1,7 @@ +library("lintr") +library("testthat") + +context("lints") +test_that("Package Style", { + lintr::expect_lint_free() +}) diff --git a/tests/spelling.R b/tests/spelling.R new file mode 100644 index 0000000..4453d9c --- /dev/null +++ b/tests/spelling.R @@ -0,0 +1,5 @@ +if (requireNamespace("spelling", quietly = TRUE)) { + # regular package check + spelling::spell_check_test(vignettes = TRUE, error = TRUE, + skip_on_cran = TRUE) +} diff --git a/tests/testthat/test-stopwords.R b/tests/testthat/test-stopwords.R index 9cee964..531a691 100644 --- a/tests/testthat/test-stopwords.R +++ b/tests/testthat/test-stopwords.R @@ -1,10 +1,10 @@ context("test-stopwords.R") # Helper -createTestData <- function(sourceData, sourceName) { - testData <- lapply(names(sourceData), function(x) stopwords(x, source = sourceName)) - names(testData) <- names(sourceData) - testData +create_test_data <- function(source_data, source_name) { + test_data <- lapply(names(source_data), function(x) stopwords(x, source = source_name)) + names(test_data) <- names(source_data) + test_data } # Sources @@ -14,23 +14,23 @@ misc <- stopwords::data_stopwords_misc smart <- stopwords::data_stopwords_smart test_that("all languages work for source: Snowball", { - testData <- createTestData(snowball, "snowball") - expect_equal(snowball, testData) + test_data <- create_test_data(snowball, "snowball") + expect_equal(snowball, test_data) }) test_that("all languages work for source: Stopwords-ISO", { - testData <- createTestData(stopwordsiso, "stopwords-iso") - expect_equal(stopwordsiso, testData) + test_data <- create_test_data(stopwordsiso, "stopwords-iso") + expect_equal(stopwordsiso, test_data) }) test_that("all languages work for source: Misc", { - testData <- createTestData(misc, "misc") - expect_equal(misc, testData) + test_data <- create_test_data(misc, "misc") + expect_equal(misc, test_data) }) test_that("all languages work for source: Smart", { - testData <- createTestData(smart, "smart") - expect_equal(smart, testData) + test_data <- create_test_data(smart, "smart") + expect_equal(smart, test_data) }) test_that("full name language returns same values", { diff --git a/tests/testthat/test-stopwords_getsources.R b/tests/testthat/test-stopwords_getsources.R index 4dbf468..ac6053d 100644 --- a/tests/testthat/test-stopwords_getsources.R +++ b/tests/testthat/test-stopwords_getsources.R @@ -1,6 +1,6 @@ context("stopwords_getsources") test_that("returns all source names", { - sourceNames <- names(getOption("stopwords_sources")) - expect_equal(sourceNames, stopwords_getsources()) + source_names <- names(getOption("stopwords_sources")) + expect_equal(source_names, stopwords_getsources()) })