Skip to content

Commit

Permalink
Address feedback from reviewer-2 (#2683)
Browse files Browse the repository at this point in the history
* Address feedback from reviewer-2

* Create CONTRIBUTING.md

* Add a note about avoiding 'main'

* Update .github/CONTRIBUTING.md

Co-authored-by: Michael Chirico <[email protected]>

* Update .github/CONTRIBUTING.md

Co-authored-by: Michael Chirico <[email protected]>

* Remove unnecessary newlines in contributing.md

* add cite to wiki page on linting

* emphasize why 'Fixes #' in description

* Add note about extended Descriptions when needed, and hint at chains.

* clarify the audience of NEWS entries

* tweak

---------

Co-authored-by: Michael Chirico <[email protected]>
  • Loading branch information
IndrajeetPatil and MichaelChirico authored Dec 2, 2024
1 parent b7cd0f6 commit 0ec3122
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 19 deletions.
39 changes: 39 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing to `{lintr}`

This outlines how to propose a change to `{lintr}`. For a detailed discussion on contributing to this, r-lib, and other tidyverse packages, please see the [development contributing guide](https://rstd.io/tidy-contrib) and our [code review principles](https://code-review.tidyverse.org/).

## Fixing typos

You can fix typos, spelling mistakes, or grammatical errors in the documentation directly using the GitHub web interface, as long as the changes are made in the _source_ file. This generally means you'll need to edit [roxygen2 comments](https://roxygen2.r-lib.org/articles/roxygen2.html) in an `.R`, not a `.Rd` file. You can find the `.R` file that generates the `.Rd` by reading the comment in the first line.

## Bigger changes

If you want to make a bigger change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed. If you’ve found a bug, please file an issue that illustrates the bug with a minimal [reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed). See the tidyverse guide on [how to create a great issue](https://code-review.tidyverse.org/issues/) for more advice.

### Adding a new linter

If you wish to contribute a new linter, the [Creating new linters](https://lintr.r-lib.org/articles/creating_linters.html) article serves as a comprehensive guide.

### Pull request process

* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("r-lib/lintr", fork = TRUE)`.

* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`. If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.

* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`. At a minimum, please avoid submitting PRs from your fork's `main` branch` as this can make the review process more complicated.

* Make your changes, commit them to Git, and create a PR using `usethis::pr_push()`. Follow the prompts in your browser to complete the process. Use a concise title for your PR that summarizes the change, and include `Fixes #issue-number` in the PR _description_. Doing so will automatically close the linked issue when the PR is merged. For complicated changes, add a textual overview of what your PR does in the description. Consider breaking up large PRs into a chain of more digestible+focused smaller PRs.

* For user-facing changes, add a bullet appropriately in the top section of `NEWS.md` (i.e. below the first header). Follow the style described in <https://style.tidyverse.org/news.html>. Most importantly, your audience for NEWS items is a package user, i.e., _not_ a package developer.

### Code style

* New code should follow the tidyverse [style guide](https://style.tidyverse.org). You can use the [styler](https://CRAN.R-project.org/package=styler) package to apply these styles.

* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.

* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests. Contributions with test cases included are easier to accept.

## Code of Conduct

Please note that the lintr project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms.
4 changes: 2 additions & 2 deletions paper/paper.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ withr::local_options(list(

# Statement of Need

A linter is a tool that analyzes code to identify potential errors, stylistic issues, or deviations from coding standards. It helps ensure consistency, readability, and best practices by flagging common mistakes, such as syntax errors, unused variables, or improper formatting. Linters are essential for improving code quality, preventing bugs, and maintaining a clean codebase, especially in collaborative development environments [@enwiki:1218663830]. `{lintr}` is an open-source package that provides linters for the R programming language, which is an interpreted, dynamically-typed programming language [@base2023], and is used by a wide range of researchers and data scientists. `{lintr}` can thus act as a valuable tool for R users to help improve the quality and reliability of their code.
In computer programming, "linting" is the process of analyzing the source code to identify possible programming and stylistic problems [@enwiki:1260589258] and a linter is a tool used for linting. A linter analyzes code to identify potential errors, stylistic issues, or deviations from coding standards. It helps ensure consistency, readability, and best practices by flagging common mistakes, such as syntax errors, unused variables, or improper formatting. Linters are essential for improving code quality, preventing bugs, and maintaining a clean codebase, especially in collaborative development environments [@enwiki:1218663830]. `{lintr}` is an open-source package that provides linters for the R programming language, which is an interpreted, dynamically-typed programming language [@base2023], and is used by a wide range of researchers and data scientists. `{lintr}` can thus act as a valuable tool for R users to help improve the quality and reliability of their code.

# Features

Expand All @@ -80,7 +80,7 @@ library(lintr)
length(all_linters())
```

Naturally, we can't discuss all of them here. To see details about all available linters, we encourage readers to see <https://lintr.r-lib.org/dev/reference/index.html#individual-linters>.
Naturally, we can't discuss all of them here. To see the most up-to-date details about all the available linters, we encourage readers to visit <https://lintr.r-lib.org/dev/reference/index.html#individual-linters>.

We will showcase one linter for each kind of common problem found in R code.

Expand Down
12 changes: 10 additions & 2 deletions paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,20 @@ @book{mcconnell2004code
publisher={Pearson Education}
}

@misc{ enwiki:1218663830,
@misc{enwiki:1218663830,
author = "{Wikipedia contributors}",
title = "Static program analysis --- {Wikipedia}{,} The Free Encyclopedia",
year = "2024",
url = "https://en.wikipedia.org/w/index.php?title=Static_program_analysis&oldid=1218663830",
note = "[Online; accessed 7-May-2024]"
note = "[Online; accessed 2-December-2024]"
}

@misc{enwiki:1260589258,
author = "{Wikipedia contributors}",
title = "Lint (software) --- {Wikipedia}{,} The Free Encyclopedia",
year = "2024",
url = "https://en.wikipedia.org/w/index.php?title=Lint_(software)&oldid=1260589258",
note = "[Online; accessed 2-December-2024]"
}

@Manual{Tierney2024,
Expand Down
33 changes: 18 additions & 15 deletions paper/paper.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Static Code Analysis for R"
date: "2024-11-28"
date: "2024-12-02"
tags: ["R", "linter", "tidyverse"]
authors:
- name: Jim Hester
Expand Down Expand Up @@ -51,18 +51,21 @@ link-citations: true

# Statement of Need

A linter is a tool that analyzes code to identify potential errors,
stylistic issues, or deviations from coding standards. It helps ensure
consistency, readability, and best practices by flagging common
mistakes, such as syntax errors, unused variables, or improper
formatting. Linters are essential for improving code quality, preventing
bugs, and maintaining a clean codebase, especially in collaborative
development environments [@enwiki:1218663830]. `{lintr}` is an
open-source package that provides linters for the R programming
language, which is an interpreted, dynamically-typed programming
language [@base2023], and is used by a wide range of researchers and
data scientists. `{lintr}` can thus act as a valuable tool for R users
to help improve the quality and reliability of their code.
In computer programming, "linting" is the process of analyzing the
source code to identify possible programming and stylistic problems
[@enwiki:1260589258] and a linter is a tool used for linting. A linter
analyzes code to identify potential errors, stylistic issues, or
deviations from coding standards. It helps ensure consistency,
readability, and best practices by flagging common mistakes, such as
syntax errors, unused variables, or improper formatting. Linters are
essential for improving code quality, preventing bugs, and maintaining a
clean codebase, especially in collaborative development environments
[@enwiki:1218663830]. `{lintr}` is an open-source package that provides
linters for the R programming language, which is an interpreted,
dynamically-typed programming language [@base2023], and is used by a
wide range of researchers and data scientists. `{lintr}` can thus act as
a valuable tool for R users to help improve the quality and reliability
of their code.

# Features

Expand All @@ -86,8 +89,8 @@ length(all_linters())
#> [1] 113
```

Naturally, we can't discuss all of them here. To see details about all
available linters, we encourage readers to see
Naturally, we can't discuss all of them here. To see the most up-to-date
details about all the available linters, we encourage readers to visit
<https://lintr.r-lib.org/dev/reference/index.html#individual-linters>.

We will showcase one linter for each kind of common problem found in R
Expand Down

0 comments on commit 0ec3122

Please sign in to comment.