Skip to content

Add formating and linting on test files#1445

Draft
tahini wants to merge 3 commits into
chairemobilite:mainfrom
tahini:lintTests
Draft

Add formating and linting on test files#1445
tahini wants to merge 3 commits into
chairemobilite:mainfrom
tahini:lintTests

Conversation

@tahini
Copy link
Copy Markdown
Contributor

@tahini tahini commented Mar 20, 2026

This adds overrides rules for the prettier and eslint rules for files in __tests__ folders.

Using a line width of 150, a little longer than our usual 120, but ok for tests, I think.
Also, it tries to fit objects in one line with the objectWrap: 'collapse' (but honestly I have no idea if I prefer with collapse or preserve, you can try locally and let me know)

@kaligrafy @samuel-duhaime Can you both take a quick look at the test file formatting and let me know if something outrages you and we should try some more rules or if to have a proper formatting once and for all in test files is worth a bit of water in our wine.

When we agree on the rules, I'll put the rules in the official config files and document in the commit message the rules we agreed upon.

Also note that I upgrade version of prettier so there are a very few changes in files that are not in test folders (2 I think)

tahini added 3 commits March 20, 2026 14:20
Upgrade the version of `prettier` package from 3.3.3 to 3.8.1. This
gives access to `objectWrap` rule, introduced in 3.5, with the
`collapse` option that fits objects to a single line when possible.

Also, introduced in 3.6, there is the `@noprettier` or `@noformat` that
can be added at the top of a file to ignore a specific file when
formatting, which can be useful for mocks or test files.
** To be documented when we agree **
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 41bcc6d5-e6c7-478b-b413-8c578f96e185

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tahini
Copy link
Copy Markdown
Contributor Author

tahini commented Mar 20, 2026

Et je sais qu'il manque des règles de linting qu'il faut ignorer ou fixer, mais avant de passer du temps là-dessus, je voulais juste votre avis sur le formatage proposé.

Copy link
Copy Markdown
Collaborator

@samuel-duhaime samuel-duhaime left a comment

Choose a reason for hiding this comment

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

Damn, ça fait un gros changements!
image

Pour ton premier avis, j'ai été voir les fichiers de test (ça me semblait mieux maintenant). Pour les règles, ça me semble aussi raisonnable.
Ma philosophie de formatting, c'est de mettre le moins de règles possible (mais parfois, on n'a pas le choix).

@samuel-duhaime
Copy link
Copy Markdown
Collaborator

T'en es où avec ce PR? :) @tahini

@tahini
Copy link
Copy Markdown
Contributor Author

tahini commented Apr 21, 2026

T'en es où avec ce PR? :) @tahini

Nulle part, c'était là pour discussion, on n'en a pas vraiment discuté! :D

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants