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

GitHub Action: Check for embedded CSS and the correct stylesheet in Typescript files #2907

Closed
palisadoes opened this issue Dec 26, 2024 · 10 comments
Assignees
Labels
feature request github_actions Pull requests that update GitHub Actions code good first issue Good for newcomers

Comments

@palisadoes
Copy link
Contributor

palisadoes commented Dec 26, 2024

Is your feature request related to a problem? Please describe.

  1. We are migrating to a single CSS file for the app. This means that we need to:
    1. eliminate all CSS embedded in our typescript code.
      1. The RegEx to do this is #([0-9a-fA-F]{3}){1,2}
    2. ensure that typescript files only reference the new single src/style/app.module.css stylesheet file
  2. There is a .github/workflows/eslint_disable_check.py file that is run as part of our GitHub actions that checks submitted files for statements in the code base that bypass our linting verification.

Describe the solution you'd like

  1. We need a script similar to the .github/workflows/eslint_disable_check.py file that is run as part of our GitHub actions.
  2. The script must:
    1. check submitted files for embedded CSS violations and print the names of the offending files prior to exiting with an error code.
    2. check submitted files to ensure that they only reference the src/style/app.module.css file and no other if a CSS file is used.
  3. The script must be named .github/workflows/css_check.py and must have the CLI option to be run against one or more directories using the --directory flag like the existing lint check script.
    1. The .github/workflows/eslint_disable_check.py uses a --directory flag to define the directory to check. When run as a GitHub action, the script will only see the PR's changed files. Therefore in your testing on your local machine it will find all files on your local machine, but in the PR testing you'll have to edit target files with minor commits to see whether it works for each committed file.
  4. It must not check unit test files
  5. The script must be added to our develop and develop-postgres branch workflows in the .github/workflows/pull-request.yml file
  6. The script must be written in python3:
    1. python black, pydocstyle, pylint, pycodestyle and flake8 linting and formatting rules applied.

    2. It must follow the Google Python Code Style guide, especially the doc string formatting

      1. https://google.github.io/styleguide/pyguide.html#383-functions-and-methods

      image

Describe alternatives you've considered

  • N/A

Approach to be followed (optional)

  • See above

Additional context

  • N/A

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@github-actions github-actions bot added test Testing application unapproved labels Dec 26, 2024
@palisadoes palisadoes added good first issue Good for newcomers github_actions Pull requests that update GitHub Actions code and removed unapproved test Testing application labels Dec 26, 2024
@palisadoes palisadoes changed the title GitHub Action: Check for embedded CSS in Typescript files GitHub Action: Check for embedded CSS and the correct stylesheet in Typescript files Dec 26, 2024
@IITI-tushar
Copy link
Contributor

@palisadoes, please assign me this.
I want to work on it.

@palisadoes
Copy link
Contributor Author

@IITI-tushar You must add the ability to exclude one or more files from analysis using --exclude_files and --exclude_directories flags like:

  • .github/workflows/countline.py

Copy link

github-actions bot commented Jan 6, 2025

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Jan 6, 2025
@IITI-tushar
Copy link
Contributor

i am working on it. currently trying to fix the conflicting files

@Cioppolo14 Cioppolo14 removed the no-issue-activity No issue activity label Jan 6, 2025
noman2002 pushed a commit that referenced this issue Jan 9, 2025
…stylesheet in Typescript files #2907 (#3041)

* done

* Update css_check.py

* Update css_check.py

* Update pull-request.yml
@palisadoes
Copy link
Contributor Author

I'm going to close this. It's not appropriate at this time

@palisadoes palisadoes closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Talawa-Admin (Tests) Jan 9, 2025
@IITI-tushar
Copy link
Contributor

i guess once we convert all the CSS to app.module.css then it we should work on this. As since my PR got merged then other PR's are started to fail... since we still are not using app.module.css in all files.

@palisadoes
Copy link
Contributor Author

i guess once we convert all the CSS to app.module.css then it we should work on this. As since my PR got merged then other PR's are started to fail... since we still are not using app.module.css in all files.

Can you run your test on only those files submitted in a PR instead, versus the entire code base?

@IITI-tushar
Copy link
Contributor

@palisadoes good idea sir... I will give it a try.

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Jan 21, 2025
@IITI-tushar
Copy link
Contributor

I am working on it...

@github-actions github-actions bot removed the no-issue-activity No issue activity label Jan 21, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Talawa-Admin (Tests) Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request github_actions Pull requests that update GitHub Actions code good first issue Good for newcomers
Projects
Status: Done
Development

No branches or pull requests

3 participants