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

Adds new lost-vars functionality. #389

Merged
merged 2 commits into from
Jul 16, 2017
Merged

Adds new lost-vars functionality. #389

merged 2 commits into from
Jul 16, 2017

Conversation

steve-holland
Copy link
Contributor

What kind of change is this? (Bug Fix, Feature...)
Feature.

What is the current behavior (You can also link to an issue)
Solves #376. Future replacement for $lost-gutter and $lost-gutter-local variables.

What is the new behavior this introduces (if any)
New lost-vars method to output variables.

Does this introduce any breaking changes?
No.

Does the PR fulfill these requirements?

  • [✔️ ] Tests for the changes have been added
  • [✔️ ] Docs have been added or updated

Other Comments
I've updated lg-gutter so that it shares same functionality as new lost-vars method, save duplicating code. Only thing I'm not sure you'll like is how I've broken out each of the new variable methods into its own file. See what you think, I can always change it if you aren't keen.

@codecov
Copy link

codecov bot commented Jul 11, 2017

Codecov Report

Merging #389 into develop will increase coverage by 0.35%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #389      +/-   ##
===========================================
+ Coverage    91.66%   92.02%   +0.35%     
===========================================
  Files           16       19       +3     
  Lines          672      702      +30     
===========================================
+ Hits           616      646      +30     
  Misses          56       56
Impacted Files Coverage Δ
lib/lost-vars.js 100% <100%> (ø)
lib/lost-vars-gutter-local.js 100% <100%> (ø)
lib/lost-vars-gutter.js 100% <100%> (ø)
lib/lg-gutter.js 100% <100%> (ø) ⬆️
lost.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c63edbf...f0ae605. Read the comment docs.

Copy link
Owner

@peterramsing peterramsing left a comment

Choose a reason for hiding this comment

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

Gah! I'm in love with this code!

  1. Brilliant how you have lgGutter extend the logic of this!
  2. The lost-vars() logic is really nice. It'll be really nice to expand on!
  3. There looks like possible duplicate tests. (see comment)
  4. It'd be nice to have a test for both gutter and gutter-local in one declaration. (see comment)
  5. Do we want to add a warning to the existing lgLogic implementation since we're planning on deprecating it in the future?

That's all I can think of right now. This is awesome stuff!

);
});
it('allows for multiple uses of the variable', () => {
check(
Copy link
Owner

Choose a reason for hiding this comment

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

Is this a duplicate of the test on ln15?

Copy link
Contributor Author

@steve-holland steve-holland Jul 12, 2017

Choose a reason for hiding this comment

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

It is, great minds again! I'd done one of my own and then repurposed your tests, which had one too. I've removed this one as it was specific to just gutter-local. Whereas the other one covers both.

);
});

it('matches multiple variables', function() {
Copy link
Owner

Choose a reason for hiding this comment

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

It might also be good to have a test for the use of both the lost-vars('gutter') and lost-vars('gutter-local') in one declaration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated this test to include a new check which does just that.

lib/lost-vars.js Outdated

var variableFunctions = {
'gutter': lostGutter,
'gutter-local': lostGutterLocal
Copy link
Owner

Choose a reason for hiding this comment

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

A hanging comma on this would help with future diffs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

}

variables.forEach(variable => {
var func = variableFunctions[variable];
Copy link
Owner

Choose a reason for hiding this comment

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

I'm in love with this code!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I'm really enjoying working on Lost :)

@equinusocio
Copy link

equinusocio commented Jul 12, 2017

What release will include this feature?

@peterramsing
Copy link
Owner

At this point, since it's done I don't see why it has to wait for 8.3. I'm the holdup on 8.2 and getting the test coverage up #381. 😳

@peterramsing peterramsing modified the milestones: v8.2, v8.3 & v8.4 Jul 13, 2017
@peterramsing peterramsing merged commit 54f353a into peterramsing:develop Jul 16, 2017
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.

3 participants