Skip to content

Commit

Permalink
add trailing-whitespace and end-of-file-fixer linters (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Jan 30, 2025
1 parent ba76841 commit e4eb4ac
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
---
exclude: |
(?x)^(
test-data/.*
test-data/.*|
docs/.*html|
docs/.*js|
docs/.*css
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.7.0.1
hooks:
Expand All @@ -15,7 +23,7 @@ repos:
- id: shellcheck
args: ["--exclude=SC2002"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
# additional_dependencies: [tomli]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub Actions Build Status](https://github.com/uptake/uptasticsearch/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/uptake/uptasticsearch/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/uptake/uptasticsearch/branch/main/graph/badge.svg)](https://codecov.io/gh/uptake/uptasticsearch)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version-last-release/uptasticsearch)](https://cran.r-project.org/package=uptasticsearch)
[![CRAN\_Download\_Badge](https://cranlogs.r-pkg.org/badges/grand-total/uptasticsearch)](https://cran.r-project.org/package=uptasticsearch)
[![CRAN\_Download\_Badge](https://cranlogs.r-pkg.org/badges/grand-total/uptasticsearch)](https://cran.r-project.org/package=uptasticsearch)

## Introduction

Expand Down Expand Up @@ -58,7 +58,7 @@ The examples presented here pertain to a fictional Elasticsearch index holding s

### Example 1: Get a Batch of Documents <a name="example1"></a>

The most common use case for this package will be the case where you have an Elasticsearch query and want to get a data frame representation of many resulting documents.
The most common use case for this package will be the case where you have an Elasticsearch query and want to get a data frame representation of many resulting documents.

In the example below, we use `uptasticsearch` to look for all survey results in which customers said their satisfaction was "low" or "very low" and mentioned food in their comments.

Expand Down Expand Up @@ -106,7 +106,7 @@ commentDT <- es_search(

### Example 2: Aggregation Results <a name="example2"></a>

Elasticsearch ships with a rich set of aggregations for creating summarized views of your data. `uptasticsearch` has built-in support for these aggregations.
Elasticsearch ships with a rich set of aggregations for creating summarized views of your data. `uptasticsearch` has built-in support for these aggregations.

In the example below, we use `uptasticsearch` to create daily timeseries of summary statistics like total revenue and average payment amount.

Expand Down
8 changes: 4 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
* Windows via `devtools::build_win()`

### `R CMD check` results
* There were no ERRORs, WARNINGs.
* One NOTE from `checking CRAN incoming feasibility ...` can be safely ignored since it's a note that notifies CRAN that this is a new maintainer/submission.
* There were no ERRORs, WARNINGs.
* One NOTE from `checking CRAN incoming feasibility ...` can be safely ignored since it's a note that notifies CRAN that this is a new maintainer/submission.

### CRAN Response
* Automatic checking upon CRAN submission yielded two notes. One was the "incoming feasibility..." item we mentioned above, which is not an issue.
* Automatic checking upon CRAN submission yielded two notes. One was the "incoming feasibility..." item we mentioned above, which is not an issue.
* The other note said that `Author field differs from that derived from Authors@R`. This did not arise when running `R CMD check --as-cran` locally, but it looks like "fnd" is not a supported tag for an author. Removed that tag.

## v0.0.2 - Submission 2 - (July 17, 2017)
Expand Down Expand Up @@ -115,7 +115,7 @@ In this submission, we changed maintainer from `[email protected]` to `jayla

> This is a release to add support for Elasticsearch 7.x, a major release stream that has been General Availability since April 2019.
> You may see that the maintainer email is changing from "[email protected]" to "[email protected]". This is a contact info update only, not an actual maintainer change. The "uptake.com" address is tied to the company that holds copyright over this project (https://github.com/uptake/uptasticsearch/blob/master/LICENSE#L3). I no longer work there but have received their permission to continue on as the maintainer. If you need confirmation you can contact my coauthors who still work there ([email protected], [email protected]) or that company's legal team ([email protected])
> You may see that the maintainer email is changing from "[email protected]" to "[email protected]". This is a contact info update only, not an actual maintainer change. The "uptake.com" address is tied to the company that holds copyright over this project (https://github.com/uptake/uptasticsearch/blob/master/LICENSE#L3). I no longer work there but have received their permission to continue on as the maintainer. If you need confirmation you can contact my coauthors who still work there ([email protected], [email protected]) or that company's legal team ([email protected])
### `R CMD check` results
* No issues
Expand Down
1 change: 0 additions & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ pkgdown_sha: ~
articles:
FAQ: FAQ.html
last_built: 2020-05-12T04:27Z

2 changes: 1 addition & 1 deletion r-pkg/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
YEAR: 2017
COPYRIGHT HOLDER: Uptake Technologies Inc.
ORGANIZATION: Uptake Technologies Inc.
ORGANIZATION: Uptake Technologies Inc.
12 changes: 6 additions & 6 deletions r-pkg/vignettes/FAQ.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ Developing queries of your own for elasticsearch is sometimes tough. If you are

### Troubleshooting Guide

* Are all your **brackets and curly braces** correct and paired? Check just to make sure.
* Are you **quoting** things correctly? This syntax calls for an awful lot of quotation marks, don't forget them.
* Are all your **brackets and curly braces** correct and paired? Check just to make sure.
* Are you **quoting** things correctly? This syntax calls for an awful lot of quotation marks, don't forget them.

## Query Returns No Results

After you have verified with certainty that your query is appropriately structured and written, you might still have challenges. What to do if you get the error `Query is syntactically valid but 0 documents were matched. Returning NULL` ?

### Troubleshooting Guide

* Are your **search terms** named and described correctly? All spelled right?
* Are you looking in the **correct index**? Perhaps your document is in a different one.
* If you are passing **dates or datetimes**, are the formats of your input formatted just right?
* IMPORTANT: **Are the terms you are using indexed**? This is a tricky one. Your term may exist and have data in the documents, but if your particular elasticsearch database has not indexed that term, you won't be able to use it for searching. This does not mean that the document/s aren't there, but just that you can't use that term for searching.
* Are your **search terms** named and described correctly? All spelled right?
* Are you looking in the **correct index**? Perhaps your document is in a different one.
* If you are passing **dates or datetimes**, are the formats of your input formatted just right?
* IMPORTANT: **Are the terms you are using indexed**? This is a tricky one. Your term may exist and have data in the documents, but if your particular elasticsearch database has not indexed that term, you won't be able to use it for searching. This does not mean that the document/s aren't there, but just that you can't use that term for searching.
* Are you sure the **document exists**? It might just not be there.

***
Expand Down

0 comments on commit e4eb4ac

Please sign in to comment.