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

Add code example of how one can enable ruby formatter in VS Code #1911

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bibstha
Copy link

@bibstha bibstha commented Apr 10, 2024

Motivation

Since I was instructed to open a PR in this repo in Shopify/vscode-shopify-ruby#595, doing so now. cc: @vinistock

Shopify/vscode-shopify-ruby#443

It's easier to glance over the line that says to add rubocop or syntax_tree gem in Gemfile. Adding a concrete code example makes it find the solution.

I've seen few people ask about this in support issues in the repo as well.

Implementation

Just the readme update.

Automated Tests

NA

Manual Tests

NA

It's easier to glance over the line that says to add `rubocop` or `syntax_tree` gem in Gemfile. Adding a concrete code example makes it find the solution.

I've seen few people ask about this in support issues in the repo as well.
@bibstha bibstha requested a review from a team as a code owner April 10, 2024 17:54
vscode/README.md Show resolved Hide resolved
vscode/README.md Outdated

```ruby
# Gemfile
group :development do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linters usually need to also run in CI, so let's say group :development, :test do. This matches what Rails 8 will do: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/Gemfile.tt

vscode/README.md Outdated
```ruby
# Gemfile
group :development do
# You can uncomment one of the following to get either rubocp or syntax_tree formatter enabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is an example, I think it's enough to just say gem "rubocop" and remove the comment.

@bibstha bibstha requested a review from andyw8 April 10, 2024 18:51
```

Make sure to run `bundle install` after making the above change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the final new line or an extra empty line at the end? If it's an empty line, can we please remove it?

@egiurleo egiurleo removed their request for review April 10, 2024 21:46
@andyw8
Copy link
Contributor

andyw8 commented Apr 11, 2024

@bibstha since these instructions aren't specific to VS Code, we should add them to the main README instead. I'd suggest adding a new section, e.g. 'Formatting and Linting'. Once added, we can add a link to it from the VS Code README to help people find it.

@KaanOzkan KaanOzkan removed their request for review April 12, 2024 13:31
@andyw8
Copy link
Contributor

andyw8 commented May 10, 2024

Hi @bibstha, are you able to continue on this?

After discussing with @vinistock, we think it could be better to have an explicit statement like “Using globally installed formatters or linters is not supported, they must in your Gemfile or gemspec”. Then there is not any need for the sample code.

@bibstha
Copy link
Author

bibstha commented May 10, 2024

Yes, will make the change later today.

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.

None yet

3 participants