Skip to content

implement auto formatting #1528

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

Merged
merged 1 commit into from
Jul 14, 2025
Merged

Conversation

Tetrax-10
Copy link
Contributor

When a commit is pushed the repo will format itself and on PR it will just check if their code follows the formatting rules.

I formatted all the files inside .github as github actions won't allow changes on workflow files.

@sameerasw sameerasw added the enhancement New feature or request label Jul 14, 2025
@sameerasw sameerasw merged commit b4e0e7f into sameerasw:main Jul 14, 2025
@sameerasw
Copy link
Owner

Thanks a lot for implementing this <3

@Tetrax-10 Tetrax-10 deleted the auto-formatting branch July 14, 2025 16:59
@Tetrax-10
Copy link
Contributor Author

Tetrax-10 commented Jul 14, 2025

You're welcome. The repo should format it self idk why its un-formatted. It worked on my repo. Any permission problem?

Edit: Oh wait its disabled. Any reason disabling the workflow? Would you want it to work differently?

Edit 2: I'm just dumb it worked perfectly! Lol, I need some sleep.

@sameerasw
Copy link
Owner

You're welcome. The repo should format it self idk why its un-formatted. It worked on my repo. Any permission problem?

Edit: Oh wait its disabled. Any reason disabling the workflow? Would you want it to work differently?

Edit 2: I'm just dumb it worked perfectly! Lol, I need some sleep.

Sorry, I forgot to inform you, I merged it with the main workflow. So I disabled the secondary one since running two actions that modify code with commits can lead to out of sync deployments. So I made the main script first format css, then build the styles.json. Once that's done, deployment gets triggered.

@Tetrax-10
Copy link
Contributor Author

Bro where is the .css extension?

https://github.com/sameerasw/my-internet/blob/main/websites/assetstore.unity.com

And you can just remove this in the format_repo.yml:

  push:
    branches:
      - main

So it only checks if the PRs are correctly formatted (dry run).

And I request you to give second thoughts on the @ for descriptive comments because people might just forget to do that as there will be 100s of descriptive comments and it fucks-up the code base. Its so easy for me to fix that and implement feature: and edit all the 500+ css. I hope by this way the code base will remain well organized, easy to understand, less bloated.

@sameerasw
Copy link
Owner

Bro where is the .css extension?

https://github.com/sameerasw/my-internet/blob/main/websites/assetstore.unity.com

In my defense, it was from a contribution... which I didn't check well LOL.

Also about the comments thing, I made it so it ignores any comment inside the list of selectors or inside the properties... Check the example.com.css .....for an example... Which I forgot to reset after testing. It's just that top level comments need that @ at front. It's hard to flip them all not only because of the flipping process, but that will also mean that we have to only include comments that contain @ and need to filter that during json generation.. basically to flip it. but might be confusing for contributors.

And the formatting, I do need not only for PRs but also for commits too. Because styles aren't edited inside an IDE so they are all over the place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants