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

Apply Linting Only to Files Updated in git #1270

Closed
palisadoes opened this issue Dec 23, 2023 · 7 comments
Closed

Apply Linting Only to Files Updated in git #1270

palisadoes opened this issue Dec 23, 2023 · 7 comments
Assignees
Labels
feature request test Testing application

Comments

@palisadoes
Copy link
Contributor

palisadoes commented Dec 23, 2023

We need the ability to selectively adjust our linting rules so that they are eventually applied to our entire code base.

  1. Linting rules are managed by the .eslintrc.json file.
  2. They are applied to the entire code base at once.
  3. If we change a rule from warn to error then every file in the code base will be checked and we have frequently seen our tests fail for dozens of files in hundreds of lines of code.

This is not acceptable.

We have been trying to more strictly lint the entire code base manually, but it has been very slow.

At the user CLI

We need a way to edit .eslintrc.json with increasingly stricter linting rules in such a way that the tests are only applied to the changed files with every git commit and git push command.

These git commands must fail if the linting fails.

With Every Pull Request

We recently merged a Talawa-API pull request that checks each submitted file for linting compliance. This can be used as an example of how to run the test against individual files.

You must make sure that this functionality applied for all PRs for this repository whenever the .eslintrc.json file is updated

Other

  1. There may be ways to achieve the CLI goals by updating our existing Git Hooks
  2. Your solution should preferably work within coding environments such as VScode
  3. Please work with @anwersayeed and @tasneemkoushar on this issue
  4. Related issues:

Screenshots

When complete, you should be able to convert all these .eslintrc.json file lines containing warn to error and the tests will only be applied to the changed files in git

image

@github-actions github-actions bot added test Testing application unapproved labels Dec 23, 2023
@palisadoes palisadoes changed the title Apply Linting Only to Updated Files Apply Linting Only to Files Updated in git Dec 23, 2023
@Shubh152
Copy link
Contributor

Please assign this issue to me

@palisadoes
Copy link
Contributor Author

@Nitya-Pasrija Please be aware of this issue

@Nitya-Pasrija
Copy link
Contributor

Nitya-Pasrija commented Jan 1, 2024

Will look into it

@Veer0x1
Copy link
Contributor

Veer0x1 commented Jan 6, 2024

@Cioppolo14 I would like to work on this issue.

@Cioppolo14
Copy link
Contributor

@Veer0x1 If the issue has already been assigned, please don't ask to be assigned. We want everyone to get a chance.

@palisadoes
Copy link
Contributor Author

@Shubh152

  1. You didn't update the .eslintrc.json file with all the options above. The image below is what you have implemented in the PR
  2. Please open another PR to finish the job

image

palisadoes pushed a commit that referenced this issue Jan 12, 2024
… in git #1270" (#1397)

* make requested changes

* restore original scripts

* add eslint rules and plugins

* fix duplicate imports and tsdoc tags

* fix conflict with src/screens/Requests/Requests.tsx
@palisadoes
Copy link
Contributor Author

I'm going to open another issue to finish the job so that someone else can get a chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request test Testing application
Projects
None yet
Development

No branches or pull requests

5 participants