Coder Social home page Coder Social logo

Comments (6)

AlexB52 avatar AlexB52 commented on May 27, 2024

Hi @nickhammond

Thanks for the feedback and glad you enjoy retest.

Having a <changed> reference for retest seems like an excellent idea. I'll think about how this could work out. Few things need to be considered like when <test> and <changed> are the same for example.

I'll definitely consider this for the next release but I can't promise a time frame.

from retest.

AlexB52 avatar AlexB52 commented on May 27, 2024

Hello @nickhammond

I have release v1.5.0 which allows you to do what you want.

Based on your example I would recommend using

retest 'bin/rails test <test> && bundle exec rubocop <changed>'

instead of

retest 'bin/rails test <test> && bundle exec rubocop <test> <changed>'

For example, if we have a post.rb and post_test.rb files. Here are the different scenarios

A change on post.rb results in:

  • <changed> => post.rb
  • <test> => post_test.rb

A change on post_test.rb results in:

  • <changed> => post_test.rb
  • <test> => post_test.rb

Let me know if this works as expected :)
Cheers

from retest.

nickhammond avatar nickhammond commented on May 27, 2024

This is great!! I'll give this a go tomorrow and let ya know.

from retest.

nickhammond avatar nickhammond commented on May 27, 2024

@AlexB52 Thanks for making this change!

Only feedback I have would be to update the "Files Selected" labels to match the placeholders, swap file: with changed:, your call though.

Files Selected:
  - file: test/models/coupon_test.rb
  - test: test/models/coupon_test.rb
retest 'bin/rails test <test> && bundle exec rubocop <changed>'

from retest.

nickhammond avatar nickhammond commented on May 27, 2024

@AlexB52 Having <test> <changed> is actually intentional here so that Rubocop will run against both the test and the implementation file, this is to ensure that the cops run against the test files as well. Removing <test> from the retest command only runs it against one file instead of two.

retest 'bin/rails test <test> && bundle exec rubocop <test> <changed>'

from retest.

AlexB52 avatar AlexB52 commented on May 27, 2024

Awesome thanks @nickhammond
Changing file to changed seems like a good idea. I'll create an issue for this.
Cheers

from retest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.