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

Add Lint and Type check for Pull request #264

Open
growupanand opened this issue Jun 3, 2024 · 11 comments · May be fixed by #388
Open

Add Lint and Type check for Pull request #264

growupanand opened this issue Jun 3, 2024 · 11 comments · May be fixed by #388
Assignees
Labels
hacktoberfest Infrastructure Working on non-customer facing efforts (e.g. hosting, orchestration, build pipel level2

Comments

@growupanand
Copy link
Owner

growupanand commented Jun 3, 2024

We can create a workflow using Git Actions, this workflow will check Lint errors and Type errors in the changes of Pull request. Checking of Lint and Type errors are already implemented in repo and can be run by below command.

pnpm lint && pnpm type-check

@growupanand growupanand added gssoc GirlScript Summer of Code level2 Infrastructure Working on non-customer facing efforts (e.g. hosting, orchestration, build pipel labels Jun 3, 2024
@mansi104-ai
Copy link

Please assign this issue to me under gssoc 24

@growupanand
Copy link
Owner Author

@mansi104-ai assigned to you.

@growupanand
Copy link
Owner Author

@mansi104-ai , can you please share the status? Let me know if you need any help.

@mansi104-ai
Copy link

@convoform/api:lint: Pages directory cannot be found at C:\Users\mansi\GSSOC\convoform\ConvoForm\packages\api\pages or C:\Users\mansi\GSSOC\convoform\ConvoForm\packages\api\src\pages. If using a custom path, please configure with the no-html-link-for-pages rule in your eslint config file.

I am getting this error on running workflow , could you please help?

I have already tried adding no-html-link-for-pages, but didn't work

@growupanand
Copy link
Owner Author

@mansi104-ai , Are you still working on this?, because the PR is showing closed.

@mansi104-ai
Copy link

mansi104-ai commented Jun 11, 2024

Yes, sir I am working on it

@growupanand
Copy link
Owner Author

@mansi104-ai, can you please share the status?

@growupanand growupanand removed the gssoc GirlScript Summer of Code label Sep 24, 2024
@IdrisGit
Copy link

Is this issue still open?

I think you want to do a lint and type check whenever someone opens up a new PR. For that, we can create a new workflow that will run GitHub action whenever someone opens up a new PR against the main branch and do the lint and type checks.

Let me know if this is what you want or something else.

I can pick up the issue.

@growupanand
Copy link
Owner Author

@IdrisGit yes, you can do this. I want to create a workflow where we check lint and type checks as same which are being done in local machine before doing commit.

This will ensure that if someone skip the pre-commit hook, So still there is not lint or type error in there PR.

@IdrisGit
Copy link

Ok great, I will create a workflow file that will run on every PR raised.

I am participating in Hacktoberfest this year, can you add hacktoberfest label to this issue?

@IdrisGit
Copy link

The root package.json file has these scripts, that are used in the pnpm lint && pnpm type-check command suggested to be used in the issue.

 "lint": "dotenv -e .env.local -- biome lint --write . --unsafe",
 "type-check": "dotenv -e .env.local -- biome check --staged --write . --unsafe --no-errors-on-unmatched",

However, these scripts are not suitable for CI checks as they use the --write flag, which is used to auto-fix lint or check issues. In CI, it would just fix those issues in the checkout repo and do nothing. We would ideally want it to check for issues and throw errors. Therefore, I have added new scripts in the package.json file and used them in the workflow.

I am almost done with the changes and will raise the PR soon. I am not sure about the script names that I have added. Please provide suggestions for those in the PR or any other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Infrastructure Working on non-customer facing efforts (e.g. hosting, orchestration, build pipel level2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants