Skip to content

docs: fix is_*() return value for nonexistent paths (#516)#517

Open
LeonidasZhak wants to merge 1 commit into
r-lib:mainfrom
LeonidasZhak:fix/is-file-doc-return-value
Open

docs: fix is_*() return value for nonexistent paths (#516)#517
LeonidasZhak wants to merge 1 commit into
r-lib:mainfrom
LeonidasZhak:fix/is-file-doc-return-value

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

The documentation for is_file(), is_dir(), is_link(), and is_file_empty() states that NA is returned for nonexistent paths. The actual behavior (since at least the current implementation) is to return FALSE.

This PR updates the @return documentation to match the implementation.

Related issue

Fixes #516

Changes

  • R/is.R:4 — Change NA to FALSE in @return roxygen tag
  • man/is_file.Rd:26 — Regenerated Rd matching the roxygen source

Validation

  • tools::checkRd('man/is_file.Rd') passes with no warnings
  • Diff is 2 lines in 2 files, doc-only

Reproducible example

fs::is_file("nonexistent")
#> nonexistent 
#>       FALSE
# Expected per docs: NA
# Actual: FALSE

The documentation for is_file(), is_dir(), is_link(), and
is_file_empty() stated that NA is returned for nonexistent paths.
The actual behavior is to return FALSE. Update @return docs to
match the implementation.

Fixes r-lib#516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] is_*() return FALSE for nonexistent paths, but documentation says they should return NA

1 participant