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

run from repo (not gem) #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

MSP-Greg
Copy link

From plugin directory:

rubocop -f extension_review -c<path to repo>/rubocop-sketchup/.rubocop.yml

From plugin directory:

rubocop -f extension_review -c<path to repo>/rubocop-sketchup/.rubocop.yml
@thomthom
Copy link
Member

Can you fill in some background to these changes?

@MSP-Greg
Copy link
Author

I forked the repo, and tried to run it. Didn't work. With PR, I believe it does.

I can run the tests with whatever version of Ruby, don't need to install the gem...

@thomthom
Copy link
Member

Ah I see. I also see that rubocop itself also use relative paths. I'll make a note of that.

@thomthom
Copy link
Member

Hmm.. how is rubocop able to use rubocop-sketchup if it's not installed as a gem using that command line: rubocop -f extension_review -c<path to repo>/rubocop-sketchup/.rubocop.yml

Is it the require: rubocop-sketchup line within the YAML that makes rubocop require it relative to the YAML file?

Also, it appear strange to use rubocop-sketchup/.rubocop.yml as a config - as that is set up for rubocop-sketchup itself, not reviewing extensions. It even disables the custom cops.

@MSP-Greg
Copy link
Author

MSP-Greg commented Jul 24, 2022

@thomthom

I haven't pushed to this branch, but locally rebasing on PR #156, it does run correctly. I don't recall if I made additional changes, but running the following did work (RuboCop installed as a gem):

rubocop -f RuboCop::Formatter::ExtensionReviewFormatter -c<path to repo>/rubocop-sketchup/.rubocop_extension.yml

It doesn't make much sense to use the existing .rubocop.yml on a plugin/extension, so I added a file .rubocop_extension.yml, which just runs the SketchUp cops as listed in the manual.

I'll wait on your thoughts re PR #156, and update this.

EDIT: You on vacation?

@thomthom
Copy link
Member

So this change is to allow running rubocop with rubocop-sketchup loaded from source without intermediate installs?

@MSP-Greg
Copy link
Author

So this change is to allow running rubocop with rubocop-sketchup loaded from source without intermediate installs?

Correct. Users should still be allowed to install it as a gem, but it makes it easier to test with new Ruby/SU versions, and new RuboCop versions.

I'm probably more familiar with 'working with source' than most users...

Let me know if want the merge conflict fixed...

@thomthom
Copy link
Member

Let me know if want the merge conflict fixed...

Yes, if you don't mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants