Skip to content

chore: added code formating target#8

Merged
xermicus merged 2 commits into
paritytech:mainfrom
0xf333:0xf333/added-formating-target
May 3, 2024
Merged

chore: added code formating target#8
xermicus merged 2 commits into
paritytech:mainfrom
0xf333:0xf333/added-formating-target

Conversation

@0xf333
Copy link
Copy Markdown
Contributor

@0xf333 0xf333 commented May 3, 2024

Description

Since 'make test' is frequently used during development, adding the codebase formatting target as a prerequisite to it, will help maintain consistency in the codebase more easily.

Usage

During testing, formatting will automatically be applied

make test

Or

If you only want to format the codebase without running the tests, you should just run:

make format

Description
===========
Since 'make test' is frequently used
during development, adding the codebase
formatting target as a prerequisite
to it, will help maintain consistency
in the codebase more easily.

Usage
=====
```
make test
```

If you only want to format the codebase
without running the tests, run:
```
make format
```
@0xf333
Copy link
Copy Markdown
Contributor Author

0xf333 commented May 3, 2024

@xermicus

Copy link
Copy Markdown
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

Good idea however can we just --check instead of applying? This way executing tests won't potentially change source code (which is a very unexpected thing to do for tests). Also I'm about to add basic CI jobs where we want to re-use the Makefile targets, and with --check it'll be directly reusable since it returns non-zero exit code if it finds unformatted code.

Comment thread Makefile Outdated
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
@0xf333
Copy link
Copy Markdown
Contributor Author

0xf333 commented May 3, 2024

Good idea however can we just --check instead of applying? This way executing tests won't potentially change source code (which is a very unexpected thing to do for tests). Also I'm about to add basic CI jobs where we want to re-use the Makefile targets, and with --check it'll be directly reusable since it returns non-zero exit code if it finds unformatted code.

@xermicus
I see what you mean.
Commit pushed with the suggested change

Copy link
Copy Markdown
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

Thanks!

@xermicus xermicus merged commit c547a9e into paritytech:main May 3, 2024
@0xf333 0xf333 deleted the 0xf333/added-formating-target branch May 3, 2024 10:07
xermicus added a commit that referenced this pull request Jun 5, 2026
Signed-off-by: xermicus <bigcyrill@hotmail.com>
Co-authored-by: xermicus <bigcyrill@hotmail.com>
Reviewed-on: https://forgejo.lab/neo/revive/pulls/8
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