Epitech Banana (v4) Coding Style Helper
Warning
This tool is unfortunately only usable by Epitech students.
You need to have access to epiclang and banana-coding-style-checker repos to be able to use cs2.
- Easily install epiclang & banana-coding-style-checker (see here)
- Remove duplicate errors1
- Pipe current command:
make 2>&1 | cs2 cs2 run <command>
- Pipe current command:
- Finds your build system2 and builds it automatically
- Ignores all errors from files in your
.gitignore - CI friendly (GitHub Actions here)
There are multiple ways to use cs2.
cs2Only running cs2 will automatically find your build system, recompile your project by using epiclang and banana.
Warning: your project must need to support changing environment variables like CC to use epiclang.
Enable parallelism with -j
cs2 -j
cs2 -j2 # You can specify the amount of threads like thatIf in your Makefile, you're compiling other Makefiles (typically
make -C lib/my) that are needed for your final linkage, make sure that you use the.NOTPARALLELrule to run them in order.
Don't ignore .gitignore errors (--no-ignore)
cs2 --no-ignoreCI mode with --ci
(Only GitHub is supported for now)
cs2 --ci=github- GNU Makefile
To be supported in the future (or send a PR to make it work :-)):
- CMake (in the future)
epiclang main.c 2>&1 | cs2
cs2 run epiclang main.c
Both of these commands will run epiclang main.c and format the error output with cs2.
Mark the usage of
2>&1for piping intocs2which is necessary.
Requirements:
- Rust
- Cargo
- clang (>= 20)
- CMake
- LLVM
- llvm-libs
Use the install.sh script:
curl -s https://raw.githubusercontent.com/hugoarnal/cs2/main/install.sh | shYou can also clone the repo directly to /usr/local/share/cs2 then run compile.sh:
git clone https://github.com/hugoarnal/cs2.git /tmp/cs2-cs2
sudo mkdir -p /usr/local/share/cs2
/tmp/cs2-cs2/compile.sh
sudo mv /tmp/cs2-cs2 /usr/local/share/cs2/cs2After installing cs2, you can install epiclang package and banana plugin with:
cs2 installYou can update the packages with:
cs2 updateOnly need to update a single package? Use cs2 install/update --package:
cs2 install --package banana
cs2 update --package bananaParallelism is supported to install banana faster:
See Flags section of Build system to know more about -j flags.
cs2 install --package banana -j
cs2 update --package banana -jForce rebuild/copy (force build even with if there is no update) (cs2 update only):
cs2 update --package banana --forceNote
Ubuntu dump installs epiclang and banana by default.
It is normal if you get the X seems to be installed by a package manager warning.
If you wish to get rid of this warning, you can uninstall the package that's causing this warning but it is not recommended.
Footnotes
-
It seems as if header files work differently when using banana. When they are included, if there's an error in them, it prints it every time the header is included. ↩