Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STYLE_bug] When styling does not find a box::use, all lines are converted into NA #134

Open
radbasa opened this issue Aug 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@radbasa
Copy link
Collaborator

radbasa commented Aug 21, 2024

          @jakubnowicki Will need to go back to `box.linters::style_*`.

0.10.2 converts:

# View: Shiny modules and related code.
# https://go.appsilon.com/rhino-project-structure

to

NA
NA

Originally posted by @radbasa in Appsilon/rhino#607 (comment)

@radbasa
Copy link
Collaborator Author

radbasa commented Aug 21, 2024

We can do either of two things:

  1. Implement and activate the exclude_files parameter of box.linters::style_box_use_dir()
  2. Fix the bug converting the comment-only file to NA.

@radbasa radbasa changed the title @jakubnowicki Will need to go back to box.linters::style_*. [STYLE_bug] styling removes all comments from comments-only files Aug 21, 2024
@radbasa radbasa self-assigned this Aug 21, 2024
@radbasa radbasa added the bug Something isn't working label Aug 21, 2024
@radbasa radbasa changed the title [STYLE_bug] styling removes all comments from comments-only files [STYLE_bug] When styling does not find a box::use, all lines are converted into NA Aug 22, 2024
@jakubnowicki
Copy link
Member

Recently this also happened when there was no empty line between box::use() and the rest of the code:

box::use(
  app/main,
)
context("Test main$format_duration()")
test_that("format_duration for NULL returns empty string", {
  expect_equal(main$format_duration(NULL), c(""))
})

@vituri
Copy link

vituri commented Feb 13, 2025

Can you give me more details on how to reproduce this problem? I created a teste dir and the following file inside it:

# View: Shiny modules and related code.
# https://go.appsilon.com/rhino-project-structure
box::use(shiny)

# a
# b
1+1

Running box.linters::style_box_use_dir('teste') changed the initial file to

# View: Shiny modules and related code.
# https://go.appsilon.com/rhino-project-structure
box::use(
  shiny,
)

# a
# b
1+1

I added another file with the following content:

# View: Shiny modules and related code.
# https://go.appsilon.com/rhino-project-structure

# this file only contains comments!




# with spaces!

which was not modified with box.linters::style_box_use_dir('teste').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants