How to Use the Packwerk Plugin for RubyMine and Troubleshoot Issues

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Message originally sent by slack user U717FXJ8HWK

I’ve just released the Packwerk plugin for RubyMine. It has not yet been published on the plugin marketplace, so you will need to download it from GitHub releases and install it manually. If you encounter any issues, please report them here or create a GitHub issue.

Important note: the linter can only run when the Ruby file is in sync with the file on disk. This limitation exists because Packwerk can only lint files that have been saved to disk.

The plugin has a settings pane (Tools → Packwerk) where you can enable or disable it, as well as change the Packwerk executable path. The plugin also supports packs if you specify its path. These settings are project-specific, i.e. not global.

Thank you <@U717FXJ8HWK>, it works great :raised_hands: !
I’ll let you know if I encounter any issue :+1:

Thanks so much <@U717FXJ8HWK>!!

Message originally sent by slack user U712YWCKK8T

I’ve installed it, but it’s not appearing under settings for me :confused:

Message originally sent by slack user U712YWCKK8T

Oh interesting, I turned off the New UI and it appeared, and now it appears even if I reenable it. But it wasn’t just restarting because I tried that first :shrug:

Message originally sent by slack user U717FXJ8HWK

Perhaps a restart helped after all? :thinking_face:

Message originally sent by slack user U712YWCKK8T

That was the first thing I tried but it didn’t appear, even through a reboot (I actually installed it yesterday but didn’t have time to figure out why it didn’t appear)

Message originally sent by slack user U712YWCKK8T

Might be a New UI bug rather than a bug with the plugin

Message originally sent by slack user U712YWCKK8T

Or I just missed it

Message originally sent by slack user U717FXJ8HWK

Let me try to reinstall it

Message originally sent by slack user U717FXJ8HWK

Removed the plugin, restarted RubyMine, installed the plugin from GitHub releases, the settings pane appeared without restarting the IDE

Message originally sent by slack user U717FXJ8HWK

Maybe it’s just easy to miss among all those options under Tools

Message originally sent by slack user U712YWCKK8T

I did search for Packwerk as well and it didn’t come up, probably something went weird with my setup

Message originally sent by slack user U717FXJ8HWK

This message contains interactive elements.

Message originally sent by slack user U712YWCKK8T

Yeah it wasn’t appearing for me right after installing. Idk what happened, and I tried uninstalling, restarting, then installed again and it worked. I probably did something stupid, don’t worry about it :slightly_smiling_face:

Message originally sent by slack user U70VMMV37TJ

I am excited to try out this tool.

I believe that I have successfully installed the tool. I see under Settings → Tools → Packwerk that it is enabled and that the path is to bin/packwerk.

I’m expecting that existing items in my package_todo.yml will show up in the IDE when I open up the file with a privacy violation. I have tried modifying and saving a file to see if that will kick off packwerk, just not sure how to debug this further.

Perhaps we are showing only dependency violations?

<@U70VMMV37TJ> I can definitely see privacy violations, but I think the tool DOES take into consideration your package_todo.yml, so if you ignore a violation there you won’t see the red underline.

It’d be interesting to be able to see recorded violations too, I wonder if other folks would find it useful. It’d be easy enough to implement (packs check --ignore-package-todo that just skips filtering violations).

Message originally sent by slack user U717FXJ8HWK

The plugin will report whatever packwerk check / packs check reports, so if you don’t see the violation in the terminal, you won’t see it in the editor.

Not filtering out accepted violations in the editor sounds like a great option to have. I believe this should be the default for editor integrations.