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

Open Source the Coding Style Checker #19

Open
clement-antoine-xavier opened this issue May 21, 2024 · 9 comments
Open

Open Source the Coding Style Checker #19

clement-antoine-xavier opened this issue May 21, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@clement-antoine-xavier
Copy link

To enhance collaboration and continuous improvement, I propose making the coding style checker open source. This would allow both the community and students to contribute through pull requests, leading to a better codebase for everyone involved.

Opening up the style guide will foster a collaborative environment where users can suggest improvements, report inconsistencies, and keep the checker up-to-date.

@Sigmanificient
Copy link
Contributor

The coding style script itself is already public, only the ruleset is internal and accessible to the students. You may want to take a look at the following issue in Banana vara coding style checker:

I do agree that opening the repository to the public would be nice, to facilitate integration with existing student tools, such as Abricot-Norminette or ECSLS.

However I don't think it would help collaboration on the coding style, unfortunately. In the current state, banana accept pull requests but the review process is tedious as the APE in charge of the project as a ton of other work to process. As a manner of fact, I have opened many pull requests over the time, and some are waiting review for over a couple of month, despite fixing important bugs.

I have also mentioned the lack project normalization with standard python tooling and proposed core changes to the architecture to make the code more to readable and maintainable. To make contribution easier, we need another maintainer to work actively on the repository.

@Bqleine
Copy link

Bqleine commented May 26, 2024

The most important is for the code to be released under an open source license. Then students can do awesome stuff without needing pull requests or any intervention from EPITECH. And that would require your approval @Sigmanificient since you have non-trivial contributions to the coding style already merged.

I would greatly appreciate if you could do some lobbying from Paris, as response from the APE on my issue has been nonexistent, and just this is frankly disappointing.

@Sigmanificient
Copy link
Contributor

Sigmanificient commented May 26, 2024

Unfortunately, I am a simple student too. I requested many times for the coding style to get some attention. So far my attempts have led to nothing

@Xephi Xephi assigned Xephi and unassigned PierreEpitech and r3g31rk May 29, 2024
@erenworld
Copy link

Hi, when I run "nix run github:epitech/coding-style-checker" on Mac, it prints
Running norm in .
Found 38 issues
Ran in 1s
Any ideas on how to display my coding style errors properly? Thanks.

@Sigmanificient
Copy link
Contributor

Sigmanificient commented Jan 7, 2025

Hi, when I run "nix run github:epitech/coding-style-checker" on Mac, it prints Running norm in . Found 38 issues Ran in 1s Any ideas on how to display my coding style errors properly? Thanks.

TLDR: Use sigmapitech/cs which is kept up to date (nix run github:Sigmapitech/cs)

There have been some unsuccessful attempts at fixing/updating the nix flake provided in this repository.

Due to the way the coding style vendors its ruleset to another private repository, the flake requires to be updated on every update, to keep the hash correct.

Not having access to this repository, and unable to notify maintainers about this, I took the step to provide a working flake under my own organisation. I aim at updating it throughout my whole studenship at Epitech

@erenworld
Copy link

Thank you!

@erenworld
Copy link

@Sigmanificient Here's the response:

Running norm in .
vera++: <class 'clang.cindex.TranslationUnitLoadError'>: Error parsing translation unit.: File "/nix/store/ryic2lm32f7ayp0myp4d928vcv0x3yff-patched-ruleset/vera/rules/C-C1.py", line 82, in
check_conditional_branching()

File "/nix/store/ryic2lm32f7ayp0myp4d928vcv0x3yff-patched-ruleset/vera/rules/C-C1.py", line 79, in check_conditional_branching
for_each_function_with_statements(file, _check_conditional_branching)

File "/nix/store/ryic2lm32f7ayp0myp4d928vcv0x3yff-patched-ruleset/vera/rules/utils/functions/init.py", line 579, in for_each_function_with_statements
functions = get_functions(file)

File "/nix/store/ryic2lm32f7ayp0myp4d928vcv0x3yff-patched-ruleset/vera/rules/utils/cache.py", line 19, in wrapped
result = func(*args, **kwargs)

File "/nix/store/ryic2lm32f7ayp0myp4d928vcv0x3yff-patched-ruleset/vera/rules/utils/functions/init.py", line 180, in get_functions
parsed = clang.cindex.Index.create().parse(

File "/nix/store/xl3ygsb9fhb2l4fw8jnv5lnkbngkqzj1-python3-3.10.15-env/lib/python3.10/site-packages/clang/cindex.py", line 2989, in parse
return TranslationUnit.from_source(path, args, unsaved_files, options, self)

File "/nix/store/xl3ygsb9fhb2l4fw8jnv5lnkbngkqzj1-python3-3.10.15-env/lib/python3.10/site-packages/clang/cindex.py", line 3109, in from_source
raise TranslationUnitLoadError("Error parsing translation unit.")

None

@Sigmanificient
Copy link
Contributor

Sigmanificient commented Jan 7, 2025

Hmm it seems there is a problem deeper down the ruleset code itself, with clang parser.

I've been using the nix version on both x86_64-linux and aar64-linux, and this is the first time i do see this issue, so it would require to investigate a bit.
Can i reach you on discord? I might have a bit of a week with Tek 2 paradigm pool (i'm in 2028 promotion) coming up tomorrow but i can try to look at it in my spare time

@erenworld
Copy link

Yes sure! My discord : tkgpadex Twitter : erentrkg

Sigmanificient referenced this issue Jan 10, 2025
* Add a `flake.nix` for Nix based systems

The printing screen is based on @Sigmanificient report script.

Co-Authored-By: Sigmanificient <[email protected]>

* Add cross-platform support

* Edit the readme to inform about Nix

* Fixes and enhance the runtime script (#1)

* Fix arguments or filename too long for vera

* Add a return value to script, simplify code

* Fix edge cases happening in github actions (#2)

* 🩹 Use second for time

* 🐛 Send output to stdout instead of tty

* 📝 Keyboard goes brbr

---------

Co-authored-by: Sigmanificient <[email protected]>
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

No branches or pull requests

7 participants