WPTT / theme-sniffer

Theme Sniffer plugin using sniffs.
MIT License
269 stars 3 forks source link

Feature/show codes #159

Closed timelsass closed 5 years ago

timelsass commented 5 years ago

fixes #156

This PR adds the PHPCS codes and a copy to clipboard functionality for annotations to the report (not raw).

image

To test:

  1. Run report on twentyninteen.
  2. Ensure error/warning sources are displayed.
  3. Tool tip should be displayed on hover "Copy Annotation"
  4. Click on item.

The result is that the tooltip should change to say "Copied!" and the annotation is copied to your clipboard, so you can press ctrl+v to easily paste it in code.

Notes:

dingo-d commented 5 years ago

I have only one minor issue with this - could the copy to clipboard code be extracted to a separate class? This way we get more separation of concerns and SRP covered. I can work on this if you want 🙂

timelsass commented 5 years ago

Yeah, I was going to get there, but didn't lol - I hadn't really looked much into this area, but was thinking using either react or an underscore template might be a bit easier to work with in the future instead of cloning the empty divs too.

dingo-d commented 5 years ago

Can you fix the conflicts and the can we merge this?

Once we get all the major functionality in, I'd like to work more on tests so that we can refactor the plugin properly. As currently I see some issues with classes maybe being too big and violating the SRP.

dingo-d commented 5 years ago

HI @timelsass can you just fix the conflicts so that we can merge this? I'd like to continue the work on the theme sniffer 🙂

If you don't have the time, I can pull your branch and create a new PR with these changes (your commits should be visible).