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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(auto-fix): Implementation of --fix flag #1089

Open
wants to merge 6 commits into
base: feature/auto-fix
from

Conversation

Projects
None yet
@srowhani
Member

srowhani commented Jun 15, 2017

What do the changes you have made achieve?

  • Base implementation of --fix
  • Tests
    • Maintain coverage %
    • Test fix's already implemented as demonstration of PR capabilities
      • border-zero
      • no-css-comments
      • property-sort-order

Are there any new warning messages?

No, fix will only run if given fix config option.
If fix is run, the only difference is it will rebuild the parsed ast correctly, and write the new one into that file.

Have you written tests?

Partially, yes. Currently in the process of writing more tests.

Have you included relevant documentation

Yes, have added some explanation on how to run fix, and how to add your own rule fixes.

Which issues does this resolve?
#904
<DCO 1.1 Signed-off-by: SEENA ROWHANI seenarowhani95@gmail.com>

Let me know of any concerns or questions. I understand this PR can be risky from your perspective, so I'll do my best to address any comments.

Also, side-note, help adding rules / testing them would be really helpful. So if anyone wants to contribute, feel free to PR my fork 馃敟

Closing #997 in favour of this.

greenkeeperio-bot and others added some commits Jan 26, 2017

鉁忥笍 Fix typo in attribute-quotes documentation
Removed a redundant "the use of".
Merge pull request #1002 from sasstools/greenkeeper-front-matter-2.1.2
Update front-matter to version 2.1.2 馃殌
Merge pull request #1013 from danieldafoe/develop
鉁忥笍 Fix typo in attribute-quotes documentation
@coveralls

This comment has been minimized.

coveralls commented Jun 15, 2017

Coverage Status

Coverage increased (+1.1%) to 96.164% when pulling c230b34 on srowhani:feature/auto-fix into d96ed96 on sasstools:feature/auto-fix.

@gmccue

This comment has been minimized.

gmccue commented Aug 8, 2017

@DanPurdy @danieldafoe any chance of a merge of this PR sometime soon?

@rodolfoprr

This comment has been minimized.

rodolfoprr commented Sep 18, 2017

@srowhani thanks for your PR, it helped me a lot on a project where I needed to fix some warnings regarding the property-sort-order rule.

I just had a problem where, in a mixin, I have the following code:

@mixin global-navigation-box-shadow {
  $shadow-blur-radius: spacing(.325);
  $shadow-offset-x: 0;
  $shadow-offset-y: spacing(.5);

  $shadow-spread-radius: spacing(.25);
  box-shadow: inset $shadow-offset-x (-$shadow-offset-y) $shadow-blur-radius (-$shadow-spread-radius) rgba(color('shades-1'), .1);
}

after running --fix:

@mixin global-navigation-box-shadow {
  box-shadow: inset $shadow-offset-x (-$shadow-offset-y) $shadow-blur-radius (-$shadow-spread-radius) rgba(color('shades-1'), .1);
  $shadow-blur-radius: spacing(.325);
  $shadow-offset-x: 0;
  $shadow-offset-y: spacing(.5);

  $shadow-spread-radius: spacing(.25);
}

and running node-sass my-file.scss:

{
  "status": 1,
  "file": "my-file.scss",
  "line": 5,
  "column": 21,
  "message": "Undefined variable: \"$shadow-offset-x\".",
  "formatted": "Error: Undefined variable: \"$shadow-offset-x\".\n        on line 5 of my-file.scss\n>>   box-shadow: inset $shadow-offset-x (-$shadow-offset-y) $shadow-blur-radius (\n   --------------------^\n"
@srowhani

This comment has been minimized.

Member

srowhani commented Sep 19, 2017

@rodolfoprr I'll experiment with your snippet, thanks!

@stephanebruckert

This comment has been minimized.

stephanebruckert commented Oct 3, 2017

Good job @srowhani ! Will integrate SASS linting in my app as soon as your PR is merged

@jesperronn

This comment has been minimized.

jesperronn commented Nov 6, 2017

This branch has been ready since June 15th, could one of the maintainers please comment or merge this?

I know maintaining open-source projects is hard work, and rarely paid as well. And I fully acknowledge the maintainers lack of abundant free time.

But if you have time just to comment or evaluate this, it would help the project. Thanks a lot!

@DanPurdy

This comment has been minimized.

Member

DanPurdy commented Nov 6, 2017

@jesperronn It's not ready though? Under the have you written tests section it says partially, in the process of writing more and there are still tick boxes that aren't ticked and a reported issue with no further commits so it's assumed to not be ready. If we hear a little more about it then I'm happy to have a look and go through it and for others to get involved and work on / test this.

I don't mean to be picky with this but it's a big new feature that we haven't had time to do ourselves and we're grateful that @srowhani has taken the time to work on it but we're unsure of the status currently.

@srowhani

This comment has been minimized.

Member

srowhani commented Nov 10, 2017

@DanPurdy I've updated the description to accurately describe the PR's state. Unfortunately, cecause of other responsibilities I can't put any more time into this. Since this PR is going into a separate branch, you could pull it in and push further changes regarding this feature directly into the feature/auto-fix branch on sass-lint.

@DanPurdy

This comment has been minimized.

Member

DanPurdy commented Nov 13, 2017

Thanks @srowhani I'll have a look when i get a chance as im in a similar situation with other responsibilities at the moment. Thanks for your time and effort here.

@awaisabir

This comment has been minimized.

awaisabir commented Nov 30, 2017

I need this!

@chinmaymahajan

This comment has been minimized.

chinmaymahajan commented Jan 28, 2018

@DanPurdy I'm eagerly waiting to see the auto-resolve option, Will greatly appreciate if you give any update on this. Thanks and Great work!!

@RaulMo7

This comment has been minimized.

RaulMo7 commented Feb 2, 2018

Please give any update.

@yannbf

This comment has been minimized.

yannbf commented Mar 18, 2018

It's been quite some time.. any updates on this?

@BenoitFroment

This comment has been minimized.

BenoitFroment commented Mar 19, 2018

Impatiently waiting for this

@srowhani

This comment has been minimized.

Member

srowhani commented Mar 20, 2018

I plan on publishing a separate addon to implement these features, that will sit on top of the current implementation of sass-lint. For anyone interested, I can post updates here after some progress.

@srowhani

This comment has been minimized.

Member

srowhani commented Apr 9, 2018

I made a first pass at this add-on. You can try it out, if you want, here.

@zewa666

This comment has been minimized.

zewa666 commented Aug 23, 2018

Hey @srowhani, whats the status of this PR? Would be great to see this as part of sass-lint so that e.g the VSCode extension could start to pick up this feature as well

@srowhani

This comment has been minimized.

Member

srowhani commented Aug 24, 2018

Hello! I think as it stands the sass-lint maintainers are leaving the repo as it is. An IDE extension would definitely be nice to have!

@Johanneke

This comment has been minimized.

Johanneke commented Aug 29, 2018

@DanPurdy Has there been any progress on developing this feature?

@jhdevuk

This comment has been minimized.

jhdevuk commented Dec 7, 2018

@srowhani @DanPurdy Any ideas on when we could see this released? Would save a lot of time! Thanks 馃憤

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