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

[clojure] add cljstyle format tool #2011

Closed
practicalli-johnny opened this issue Oct 26, 2022 · 12 comments
Closed

[clojure] add cljstyle format tool #2011

practicalli-johnny opened this issue Oct 26, 2022 · 12 comments
Labels
enhancement New feature or request good first issue Good for newcomers nostale This issue or pull request is not stale, keep it open

Comments

@practicalli-johnny
Copy link
Contributor

Provide a format tool for the Clojure language linters

Proposal

Add cljstyle to the Clojure language linters with a default configuration that matches the Clojure Style Guide (which it does by default)

cljstyle provides a binary to check and fix Clojure code (.clj, .cljs, .cljc, .edn) and can format code following the Clojure style guide.

cljstyle can be configured via the .cljstyle file, so can easily be configured by the end user as well as provide a default configuration

cljstyle is available as part of the setup-clojure GitHub Action, so having the same tool in MegaLinter would help with consistency and allowing easy migration path to MegaLinter if desired.

Alternatives

cljfmt is a library cljstyle was based on. cljfmt is not availabe as a binary, so would either require building or uses as a library.

zprint is available as a binary, although it is a more general file formatting tool that requires more understanding to configure. zprint may be a useful addition along with cljstyle, especially if a good default configuration can be defined.

@practicalli-johnny practicalli-johnny added the enhancement New feature or request label Oct 26, 2022
@nvuillam
Copy link
Member

Nice proposition :)

Can it take a list of files as arguments ?

Would you eventually like to make a PR ? :)

@practicalli-johnny
Copy link
Contributor Author

practicalli-johnny commented Nov 11, 2022

Nice proposition :)

Thank you

Can it take a list of files as arguments ?

Yes, a specific file or set of files can be passed to cljstyle - e.g https://github.com/greglook/cljstyle#check-and-fix

Would you eventually like to make a PR ? :)

I would be happy to take a look, although it will have to be in a few weeks as I have a pressing deadline for my current employer (and still have some covid symptoms - hence the slow reply)

@nvuillam
Copy link
Member

@practicalli-john I know what it is... I understand, especially the part with being overloaded by tasks at our non-open-source jobs :)
I wish you to get better, good luck :)

I let this issue open, we'll see who will make the PR first ^^ ( it can also be another contributor ^^ )

@nvuillam nvuillam added the good first issue Good for newcomers label Nov 11, 2022
practicalli-johnny added a commit to practicalli-johnny/megalinter-pull-requests that referenced this issue Nov 29, 2022
Add cljstyle to check and fix the format of Clojure code

As discussed in oxsecurity#2011
@practicalli-johnny
Copy link
Contributor Author

I've started a pull request to add cljstyle, not sure if it is correct as yet.

I have only added the megalinter/descriptors/clojure.megalinter-descriptor.yml to which I made a manual change. It was not clear if I should include all the assets that build.sh generated afterward, or if the GitHub workflows generated these files.

practicalli-johnny added a commit to practicalli-johnny/megalinter-pull-requests that referenced this issue Nov 29, 2022
Add cljstyle to check and fix the format of Clojure code

As discussed in oxsecurity#2011
@nvuillam
Copy link
Member

I replied in the PR comments :)

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Dec 30, 2022
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Dec 30, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jan 30, 2023
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jan 30, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Mar 2, 2023
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Mar 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Apr 5, 2023
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Apr 5, 2023
@nvuillam
Copy link
Member

nvuillam commented Apr 5, 2023

Not stale :)
Let's make it pass someday:)

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2023

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label May 6, 2023
@nvuillam nvuillam added nostale This issue or pull request is not stale, keep it open and removed O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity labels May 6, 2023
nvuillam added a commit that referenced this issue May 13, 2023
* [clojure] Add linter cljstyle

Add cljstyle to check and fix the format of Clojure code

As discussed in #2011

* auto-generated files

All auto-generated files from running `build.sh`

* tests: update and extend tests for Clojure linters

* Use script installer + manage lint & fix args

* Fix clj-style install command

* build

* New way to install glibc

From https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc/blob/master/Dockerfile

* Fix dockerfile build

* Test folder for cljstyle

* Add clojure fix test files

* wget --quiet

---------

Co-authored-by: nvuillam <nicolas.vuillamy@gmail.com>
@nvuillam
Copy link
Member

Passed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers nostale This issue or pull request is not stale, keep it open
Projects
None yet
Development

No branches or pull requests

2 participants