Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sigmapitech/cs
Porting the epitech coding style to Nix
https://github.com/sigmapitech/cs
coding-style epitech nix
Last synced: about 1 month ago
JSON representation
Porting the epitech coding style to Nix
- Host: GitHub
- URL: https://github.com/sigmapitech/cs
- Owner: Sigmapitech
- Created: 2023-06-21T02:03:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-24T13:38:52.000Z (4 months ago)
- Last Synced: 2024-08-24T14:29:48.284Z (4 months ago)
- Topics: coding-style, epitech, nix
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CS: Coding-Style script on nix
## Example usage
```sh
nix run github:Sigmapitech/cs . --include-tests --ignore-rules=C-G1,C-O3
```## Options
- `path`: Specifies the location where the coding style will be checked, defaulting to `.`
- `--ignore-rules`: Specifies a list of rules to be ignored, separated by commas
- `--ignore-folders`: Specifies a list of folders to be ignored within the search path, separated by commas
- `--include-tests`: Specifies whether to include the test folder for checking, disabled by default
- `-h`, `--help`: Display an help message## Integrate within your `flake.nix`
To have access to a custom `cs` script with you own flags in your flake project,
you can add it you from flake inputs and export a wrapped version.Here is a minimal example.
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";cs-flake.url = "github:Sigmapitech/cs";
};outputs = { self, nixpkgs, cs-flake, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = let
cs = pkgs.writeShellScriptBin "cs" ''
${cs-flake.packages.${system}.report}/bin/cs -- \
--ignore-folders=docs,assets
'';
in pkgs.mkShell {
packages = [ cs ];
};
});
```