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

Feature: Add CSS and HTML linting using Github Actions #39

Open
kdipippo opened this issue Oct 2, 2020 · 1 comment
Open

Feature: Add CSS and HTML linting using Github Actions #39

kdipippo opened this issue Oct 2, 2020 · 1 comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@kdipippo
Copy link

kdipippo commented Oct 2, 2020

Right now, the files in the repo have inconsistent formatting issues. There's extraneous whitespace errors. This could also be elaborated to focus on HTML accessibility, i.e. https://www.a11yproject.com/.

Github Actions should be incorporated so that the linter runs every time a commit is pushed to a PR. This would enforce these standards constantly and consistently so that only polished code exists on the main branch.

I was not able to find an existing an existing Github Action in the marketplace for HTML linting: https://github.com/marketplace?type=actions&query=html

My path forward would be to create a Python script that utilizes https://pypi.org/project/html-linter/ and add that as a custom Github Action workflow to run this across all HTML files in the repo. It should error if any issues - Info, Warning, and Error - arise and block PRs from being merged. I have not started the investigation into finding a Python CSS linter to do the same with the files in the css/ folder.

@hariomkushwaha hariomkushwaha added enhancement New feature or request hacktoberfest help wanted Extra attention is needed labels Oct 3, 2020
@caseymhunt
Copy link

caseymhunt commented Oct 3, 2020

@Pepper-Wood I do not believe that contributors outside of the project are able to edit/add Github actions; at least not through the PR mechanism for Hacktoberfest.

That being said, I do think there is a way to modify the project to take advantage of pre-commit git hooks using Husky which is an npm package- this would increase the complexity of the project.

As for accessibility (a11y) in HTML, automated accessibility testing is significantly more complex than a linter. If you are committed to automated a11y testing, I recommend researching pa11y. Otherwise, reliance on developer education and testing will be much more light weight.

I am willing to work on a pre-commit git hook solution to CSS and HTML linting if there is interest. This solution, also, would allow individual developers to continue to format their files (indents / spaces / etc. ) however they choose, locally. As soon as that code is committed to the git history, it would be automatically formatted using the lint-staged plugin configured as documented.

Does this solution sound ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants