Skip to content

58 - Automatically reformat code#126

Merged
GPortas merged 13 commits intodevelopfrom
58-automatically-reformat-code
Mar 5, 2024
Merged

58 - Automatically reformat code#126
GPortas merged 13 commits intodevelopfrom
58-automatically-reformat-code

Conversation

@MellyGray
Copy link
Contributor

@MellyGray MellyGray commented Feb 8, 2024

What this PR does / why we need it:

This PR adds the automatic formatting to the repo using some pre-commit configurations. The pre-commits include:

  1. Running the formatter
  2. Running a typescript check to check the types
  3. Fix all linter errors
  4. Run the tests and check the coverage (95%)

A part from that:

  • I added some changes to the ESlint and prettier config files to match the SPA formatting
  • We were using a mix of jest, chai and sinon testing libraries, so I removed sinon and chai from the repo in favor of using only jest which simplifies the tests
  • Since I added a coverage check to the pre-commits I had to add some tests to match the 95% coverage threshold
  • I fixed some casting in some use cases because we were using the type casting as number instead of the real casting parseInt() and the tests were failing after changing from sinon assert to jest strict comparison.
  • I rewrote some jest config files from javascript to typescript

Which issue(s) this PR closes:

Special notes for your reviewer:

There are a lot of changes, but these are just formatting changes so they shouldn't affect the features.

Suggestions on how to test this:

  1. Visual inspection of the code
  2. Make a change to the source code in your local environment and commit the change to check that the pre-commit checks are running as expected
  3. Uncommit the test commit

@MellyGray MellyGray marked this pull request as draft February 8, 2024 15:03
@MellyGray MellyGray changed the title 58 automatically reformat code 58 - Automatically reformat code Feb 8, 2024
@MellyGray MellyGray added Size: 3 A percentage of a sprint. 2.1 hours. pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows labels Feb 8, 2024
@MellyGray MellyGray marked this pull request as ready for review February 8, 2024 15:27
@MellyGray MellyGray linked an issue Feb 8, 2024 that may be closed by this pull request
Base automatically changed from 113-documentation-v2 to develop February 23, 2024 16:00
@GPortas GPortas self-assigned this Feb 26, 2024
@GPortas
Copy link
Contributor

GPortas commented Feb 26, 2024

@MellyGray Can you please resolve conflicts?

Please, do not prioritize this PR if you have other pending feature-related issues, which should be our focus for the community day.

@GPortas GPortas assigned MellyGray and unassigned GPortas Feb 26, 2024
@MellyGray
Copy link
Contributor Author

@GPortas merge conflicts resolved

One question, should we merge this PR here to fix the markdown library?

@MellyGray MellyGray assigned GPortas and unassigned MellyGray Mar 4, 2024
@GPortas
Copy link
Contributor

GPortas commented Mar 4, 2024

@MellyGray

Yes, I just accepted and merged the PR. Can you please resolve the conflicts?

@MellyGray MellyGray removed their assignment Mar 4, 2024
@GPortas GPortas force-pushed the 58-automatically-reformat-code branch from 8608d6d to c5d0a10 Compare March 5, 2024 09:33
Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested the commit command as described adding a few malformed lines and I don't see any command logs or any changes to the pushed changes.

logsgit

The pushed test changes are malformed:

malformedpushed

I will revert the pushed changes if necessary.

@MellyGray

@MellyGray
Copy link
Contributor Author

@GPortas did you ran npm install to install the pre-commit package?

@MellyGray MellyGray removed their assignment Mar 5, 2024
@GPortas GPortas force-pushed the 58-automatically-reformat-code branch from bc7c565 to c5d0a10 Compare March 5, 2024 14:02
@GPortas
Copy link
Contributor

GPortas commented Mar 5, 2024

@MellyGray I missed that step, thanks!

Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

GitHub action registry push is failing since I had to force push to a previous commit to revert test commits.

@GPortas GPortas removed their assignment Mar 5, 2024
@GPortas GPortas merged commit dc12a7a into develop Mar 5, 2024
@GPortas GPortas deleted the 58-automatically-reformat-code branch March 5, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows Size: 3 A percentage of a sprint. 2.1 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

automatically reformat code

2 participants