superposition icon indicating copy to clipboard operation
superposition copied to clipboard

chore: Add a new check ensure .editorconfig rules are honored

Open leomayleomay opened this issue 1 year ago • 15 comments

Problem

This is to add a new pre-commit-hook check to ensure rules in .editorconfig will be honored, otherwise CI will fail

Solution

Introduce a new git-hooks.nix as part of flake modules, it will host the checks which will run a pre-commit-hook to ensure rules in .editorconfig will be honored, otherwise CI will fail

leomayleomay avatar May 23 '24 22:05 leomayleomay

Thanks; is this ready for review? @leomayleomay

Team - can we approve CI for this PR?

srid avatar May 23 '24 22:05 srid

Thanks; is this ready for review? @leomayleomay

Team - can we approve CI for this PR?

yes, this is ready for review, if the team could approve CI, I will see a CI failure due mal-formatted code

leomayleomay avatar May 23 '24 23:05 leomayleomay

@leomayleomay Thanks for the contribution! @srid can you approve too? I can merge after that.

Datron avatar May 24 '24 01:05 Datron

@Datron it's my pleasure :)

@srid will this check apply to .sql only or all the files?

leomayleomay avatar May 24 '24 04:05 leomayleomay

@leomayleomay we follow conventional commit guidelines for our commits, can you add that? I think chore or fix is appropriate here.

Datron avatar May 24 '24 06:05 Datron

@leomayleomay we follow conventional commit guidelines for our commits, can you add that? I think chore or fix is appropriate here.

@Datron thank you for letting me know :)

leomayleomay avatar May 24 '24 06:05 leomayleomay

@srid @Datron I've made changes to switch to eclint and lint .sql files only, please let me know if there are other types of files to lint, cheers

leomayleomay avatar May 24 '24 11:05 leomayleomay

@srid the CI failure seems to relate to devour-flake, please help out, I am running out of idea why it doesn't work for macos

leomayleomay avatar May 24 '24 12:05 leomayleomay

@srid the CI failure seems to relate to devour-flake, please help out, I am running out of idea why it doesn't work for macos

The issue is not with devour-flake but with the pre-commit-run run derivation which is failing to build. You can use nix --accept-flake-config run github:srid/nixci build in order to run CI locally.

srid avatar May 24 '24 14:05 srid

The pre-commit hook should be added to devShell shellHook too? Just like in nammayatri.

srid avatar May 24 '24 15:05 srid

The pre-commit hook should be added to devShell shellHook too? Just like in nammayatri.

indeed, I thought this PR was all about CI, now added to devShell

leomayleomay avatar May 25 '24 03:05 leomayleomay

the pre-commit now works in devShell

image

leomayleomay avatar May 25 '24 03:05 leomayleomay

@juspay/sdk-backend can you review?

Datron avatar May 25 '24 09:05 Datron

@srid @knutties can you take a look?

Datron avatar May 27 '24 06:05 Datron

@Datron please help to approve awaiting workflows, cheers

leomayleomay avatar May 27 '24 20:05 leomayleomay