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

fix: Prettier Workflow run is failing for the recent PR merges #3638

Open
1 of 2 tasks
theAravinthM opened this issue Apr 3, 2024 · 5 comments
Open
1 of 2 tasks

fix: Prettier Workflow run is failing for the recent PR merges #3638

theAravinthM opened this issue Apr 3, 2024 · 5 comments

Comments

@theAravinthM
Copy link
Collaborator

theAravinthM commented Apr 3, 2024

The Issue

As we can see in these images, Prettier Workflow run if failing for the recent PR merges. The code is not robust and not easy-to-read and this can cause linting errors.

Short term Solution

One can edit the whole index.html file by using the Prettier formatter and make a Pull Request to merge it.

Long term Solution

Although the above solution can be a temporary fix, this problem might arrive in the future as the new Contributors come in and make a PR.

  • So, it is better to mention it in the Contribution guidelines to check for this Prettier Code format as well - in order to not encounter the same issue in the future.

Tasks

  • Short Term Solution
  • Long Term Solution

image

image

@theAravinthM theAravinthM added good first issue changes requested Contributor is requested to make the required changes and removed changes requested Contributor is requested to make the required changes labels Apr 3, 2024
theAravinthM added a commit that referenced this issue Apr 4, 2024
fixed Prettier Formatting problem - fixes issue #3638 - short term solution
@theAravinthM
Copy link
Collaborator Author

Long term solution yet to be merged!

@Honeylabh
Copy link

long term solution:
1.Update Contribution Guidelines
Edit the CONTRIBUTING.md file to include Prettier formatting instructions

Code Style Guidelines

Please ensure your code follows the Prettier code style before submitting a Pull Request.

Using Prettier

  1. Install Prettier:

    npm install --save-dev prettier
    2.Format your code:
    npx prettier --write "src//*.js"
    3.Verify your changes:
    npx prettier --check "src/
    /*.js"

Enforce Code Style in CI:
name: CI

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Node.js
  uses: actions/setup-node@v2
  with:
    node-version: '14'
- name: Install dependencies
  run: npm install
- name: Run Prettier
  run: npx prettier --check "src/**/*.js"

@Honeylabh
Copy link

Short Term Solution
Reformat index.html:
Install Prettier if it's not already installed:
npm install --save-dev prettier
Run Prettier on the index.html file:
npx prettier --write index.html
Submit PR:
Commit the changes
git add index.html
git commit -m "Reformat index.html using Prettier"
git push origin your-branch

@theAravinthM
Copy link
Collaborator Author

long term solution: 1.Update Contribution Guidelines Edit the CONTRIBUTING.md file to include Prettier formatting instructions

Code Style Guidelines

Please ensure your code follows the Prettier code style before submitting a Pull Request.

Using Prettier

  1. Install Prettier:
    npm install --save-dev prettier
    2.Format your code:
    npx prettier --write "src//*.js"
    3.Verify your changes:
    npx prettier --check "src/
    /*.js"

Enforce Code Style in CI: name: CI

on: [push, pull_request]

jobs: lint: runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Node.js
  uses: actions/setup-node@v2
  with:
    node-version: '14'
- name: Install dependencies
  run: npm install
- name: Run Prettier
  run: npx prettier --check "src/**/*.js"

Hi @Honeylabh ! This looks good to me! We welcome your contribution 💯

Upon approval from other maintainers, it could be implemented! Requesting @TenTraicion , @CandidDeer and @malakada to review!

@siddharthisrani
Copy link

Hii can i solve this issue?

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

No branches or pull requests

3 participants