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

style: remove tailing whitespaces #228

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

trueNAHO
Copy link
Collaborator

No description provided.

@xokdvium
Copy link
Contributor

Maybe there should be a CI lint job to avoid committing trailing whitespaces and whatnot

@danth
Copy link
Owner

danth commented Jan 23, 2024

I would prefer an automatic fix rather than a check which simply fails.

A long time ago, I had an Actions workflow which would format the code and commit any changes back to the master branch.

https://github.com/danth/stylix/blob/6d91faf03bcb06d0265ea2881592c4d03ec95a19/.github/workflows/beautify.yml

Ideally we would have something like this which committed to the pull request branch, to avoid creating lots of small commits on master. That might be difficult due to permissions on forks.

I guess a bot which posted a review with suggested changes could be a potential workaround.

Copy link
Owner

@danth danth left a comment

Choose a reason for hiding this comment

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

This is OK to merge once the conflicts are fixed.

@jalil-salame
Copy link
Contributor

I have used https://github.com/cachix/pre-commit-hooks.nix with nixpkgs-fmt, but you can use other formatters (and even add linters like statix). Then you just need an action that runs nix flake check.

@trueNAHO
Copy link
Collaborator Author

trueNAHO commented Jan 24, 2024

I have used https://github.com/cachix/pre-commit-hooks.nix with nixpkgs-fmt, but you can use other formatters (and even add linters like statix). Then you just need an action that runs nix flake check.

For reference, my dotfiles repository adds pre-commit hooks to the Flake checks as follows:

https://github.com/trueNAHO/dotfiles/blob/c4ded960a25a3607f8d5f454bc48362523395658/flake.nix#L103-L113

Additionally, a GitHub action simply runs nix flake check:

https://github.com/trueNAHO/dotfiles/blob/c4ded960a25a3607f8d5f454bc48362523395658/.github/workflows/nix_flake_check.yml#L15

@trueNAHO trueNAHO requested a review from danth January 24, 2024 21:32
@danth danth merged commit 1a5dee1 into danth:master Jan 25, 2024
5 checks passed
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.

4 participants