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

Implement SCSS lint #1441

Closed
akibrhast opened this issue Apr 23, 2021 · 21 comments · Fixed by #1957
Closed

Implement SCSS lint #1441

akibrhast opened this issue Apr 23, 2021 · 21 comments · Fixed by #1957
Assignees
Labels

Comments

@akibrhast
Copy link
Member

akibrhast commented Apr 23, 2021

Overview

We need to implement a linter for our SCSS code such that code is more maintainable and standardized over time.

Action Items

  • Create a list of possible bare minimum SCSS linter settings that we can turn on, get an output of running those SCSS linter setting on our current codebase and comment on this issue the esLint settings and the output from running it.
  • Implement a github action that runs the SCSS linter on the files changed of the pull request if that file has a .scss extension

Resources/Instructions

As you are working on this issue, update this section with the resources and instructions that you come across and use when to implement this functionality.
CSS Linter (stylelint): https://stylelint.io/
GitHub action (Super-Linter): https://github.com/marketplace/actions/super-linter
How to Setup Article with Video: https://dev.to/n3wt0n/the-easiest-way-to-lint-any-code-github-super-linter-deep-dive-53eo

@akibrhast akibrhast added role: back end/devOps Tasks for back-end developers Complexity: Large labels Apr 23, 2021
@akibrhast akibrhast changed the title Implement scss lint Implement SCSSlint Apr 23, 2021
@akibrhast akibrhast changed the title Implement SCSSlint Implement SCSS lint Apr 23, 2021
@averdin2 averdin2 self-assigned this Apr 26, 2021
@averdin2
Copy link
Member

averdin2 commented May 1, 2021

So far, I am looking at using this GitHub Action. There seems to be a known issue with using Forks with this GitHub Action, so I need to look into it a little more.

As far as the linter itself, Stylelint seems like the way to go.

As far as the rules we should implement, no-duplicate-selectors, selector-pseudo-class-no-unknown, selector-pseudo-element-no-unknown, and selector-type-no-unknown seem to be the minimum rules we are looking for. Here is a link for the list of Stylelint rules. You can find the ones I mentioned in that link.

I still need to determine if these rules are adequate, and how to implement them with GitHub Actions.

@averdin2 averdin2 added the Status: Updated No blockers and update is ready for review label May 1, 2021
@averdin2
Copy link
Member

averdin2 commented May 4, 2021

ETA: I probably won't have another update for this until Thursday.
Progress Plan: I am planning on implementing this GitHub Action in my own repo, and I also want to attend the GitHub actions talk during the Engineering COP meeting on Wednesday to get some more knowledge on using GitHub actions.

@averdin2 averdin2 removed the Status: Updated No blockers and update is ready for review label May 11, 2021
@averdin2
Copy link
Member

averdin2 commented May 11, 2021

I set up a GitHub action on my own repo. For the actual GitHub action, I went with Super-Linter. In my initial research, I didn't find this GitHub action, but I think it is way better than the previous one I found as it was made by GitHub. I am also still sticking with Stylelint as this is the leading linter for CSS.

I was able to get the GitHub action to trigger for good linting and bad linting for pull requests given our specific needs. One complication I have run into is that Stylelint does not have a default rule for checking unused CSS classes (one of the major points of why we want to lint). I found a potential plugin that I could use, but I need to do some more research on this topic.

Below I have added a screenshot of my current YMAL file to configure my current iteration of the linting. I made some notes on the image where changes for the final version would need to be made.

Image of linter.yml

image

@averdin2
Copy link
Member

averdin2 commented May 11, 2021

I am making a comment for some action items I still need to do.

Action Items

  • Set up SCSS in my personal repo and test linter
  • Test linting GitHub action check with forked PRs
  • Figure out any other potential CSS linting rules wanted
  • See if plugin will work for linting unused CSS classes
  • Research how to use above plugin with GitHub Actions
  • Research other ways to lint unused CSS classes
  • Implement changes into website repo

@averdin2 averdin2 added the Status: Updated No blockers and update is ready for review label May 11, 2021
@averdin2
Copy link
Member

@sanchece here is that other ES Lint issue if you wanted to look into this a bit (#1442). Again, I was thinking of implementing this with Super-Linter. I think it should actually not take too long once I figure out if the CSS linter will work.

@qiqicodes
Copy link
Member

@averdin2 Can you let us know your progress in regards to this issue? Thank you =]

Progress:
Blockers:

@averdin2
Copy link
Member

The Stylelint plugin I was looking into seems to not work for me. May need some help to see if this is still a viable option to get linting on unused class selectors. Otherwise, I think we don't lint for this. The only other tools I have found are ones that remove unused class selectors, which I don't think we want to do.

@averdin2
Copy link
Member

The GitHub action appears to work properly for forked repo pull requests on the main repo.

@averdin2 averdin2 removed the Status: Updated No blockers and update is ready for review label May 27, 2021
@Sihemgourou
Copy link
Contributor

@averdin2
Please add update

  1. Progress
  2. Blockers
  3. Availability
  4. ETA

@sayalikotkar sayalikotkar added the Feature Missing This label means that the issue needs to be linked to a precise feature label. label Jun 20, 2021
@Sihemgourou Sihemgourou added Feature: Standards and removed Feature Missing This label means that the issue needs to be linked to a precise feature label. labels Jun 20, 2021
@Sihemgourou Sihemgourou added the To Update ! No update has been provided label Jun 28, 2021
@github-actions
Copy link

@averdin2 Please add update

  1. Progress
  2. Blockers
  3. Availability
  4. ETA

@Sihemgourou Sihemgourou removed the To Update ! No update has been provided label Jun 28, 2021
@averdin2 averdin2 self-assigned this Jun 30, 2021
@averdin2
Copy link
Member

averdin2 commented Jun 30, 2021

Progress: I have been done with the bulk of this work for some time now. I was looking to add a specific style rule that is not included in stylelint's rules, but I am thinking that it might just be best to not include that rule, as it could add complications to making changes to new rules in the future.

Blockers: I need to speak with Akib about the progress I have made on this issue, and we need to come up with a way to implement this into the repo's GItHub Actions.

Availability: I am now fairly available this week. I will reach out to Akib to schedule a time to discuss this issue.

ETA: As soon as I discuss this issue and my progress with Akib, I can move forward with the implementation.

@averdin2
Copy link
Member

Progress: I have implemented the GitHub action on my own website repo and everything works well. The last thing I need to do is connect the GitHub action to Hack for LA's website repo and make a PR for the new files I made to make this work. I most likely need to consult @Aveline-art in implementing GitHub actions on the Hack for LA website repo.

Blockers: None.

Availability: I think I am going to bring this up in the July 15th meeting and see if there is time to either get this done then, otherwise I will coordinate any discussions needed.

ETA: This week

@github-actions github-actions bot added Test: Update Label and removed Status: Updated No blockers and update is ready for review labels Aug 4, 2021
@averdin2
Copy link
Member

averdin2 commented Aug 5, 2021

Progress: Made plan for review. I still need to make some changes before I can open up the PR again.
Blockers: None, I am just working on this a bit slowly.
Availability: I attend most meetings and am responsive on Slack if there are any questions regarding this issue.
ETA: I should make my changes by this weekend and then open up the PR.

@averdin2 averdin2 added Status: Updated No blockers and update is ready for review and removed Test: Update Label labels Aug 5, 2021
@Sihemgourou Sihemgourou added this to the z. Technical debt milestone Aug 9, 2021
@github-actions github-actions bot added Test: Update Label and removed Status: Updated No blockers and update is ready for review labels Aug 13, 2021
@github-actions
Copy link

@averdin2

Please add update using this template (even if you have a pull request)

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures: "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) ask for help at a Tuesday or Sunday meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Tuesday, August 10, 2021 at 12:10 AM.


Note: This comment was created as part of a GitHub Action during its trial phase. If you find this GitHub Action to be disruptive/unhelpful, or if you believe there might be a bug, please leave a comment on this issue. All feedback will be used to further improve it. Thank you for your time.

@github-actions
Copy link

@averdin2

Please add update using this template (even if you have a pull request)

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures: "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Tuesday, August 17, 2021 at 12:02 AM PST.

@github-actions github-actions bot added the To Update ! No update has been provided label Aug 20, 2021
@github-actions github-actions bot added To Update ! No update has been provided and removed To Update ! No update has been provided labels Aug 27, 2021
@github-actions
Copy link

@averdin2

Please add update using this template (even if you have a pull request)

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures: "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Tuesday, August 24, 2021 at 12:03 AM PST.

@averdin2
Copy link
Member

averdin2 commented Sep 1, 2021

Update: Just waiting on a review for this PR. I also am planning on adding one more commit tomorrow.

@averdin2 averdin2 removed the To Update ! No update has been provided label Sep 1, 2021
@github-actions github-actions bot added Status: Updated No blockers and update is ready for review and removed Status: Updated No blockers and update is ready for review labels Sep 3, 2021
@github-actions
Copy link

@averdin2

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures: "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Tuesday, September 7, 2021 at 12:02 AM PST.

@github-actions github-actions bot added the To Update ! No update has been provided label Sep 10, 2021
@github-actions github-actions bot added To Update ! No update has been provided and removed To Update ! No update has been provided labels Sep 17, 2021
@github-actions
Copy link

@averdin2

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures: "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Tuesday, September 14, 2021 at 12:02 AM PST.

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

Successfully merging a pull request may close this issue.

7 participants