mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-12-22 18:21:51 +01:00
eaae3e286e
Setting up the different tools for development can be hard for new contributors. This commit adds a Nix flake that provides a reproducible development environment which is easy to set up and ensures consistent code style across all subprojects. The initial flake contains `git`, `pre-commit`, `which` and `bazelisk` wrapped as a `bazel` executable. Dependencies like Rust, Scala etc may be added in the `packages` attribute in the future. The current pre-commit configuration is a no-op. Future commits may enable the currently disabled parts of `pre-commit-hooks.nix` for a gradual transition. Supports `(x86_64|aarch64) (Linux|MacOS)` systems.
75 lines
2.0 KiB
Nix
75 lines
2.0 KiB
Nix
{ pkgs, ... }:
|
|
{
|
|
# Default hooks
|
|
# trailing-whitespace-fixer = {
|
|
# enable = true;
|
|
# name = "trailing-whitespace";
|
|
# description = "Remove trailing whitespace";
|
|
# entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/trailing-whitespace-fixer";
|
|
# types = [ "text" ];
|
|
# };
|
|
# end-of-file-fixer = {
|
|
# enable = true;
|
|
# name = "end-of-file-fixer";
|
|
# description = "Remove trailing whitespace";
|
|
# entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/end-of-file-fixer";
|
|
# excludes = [ "png" ];
|
|
# types = [ "text" ];
|
|
# };
|
|
fix-byte-order-marker = {
|
|
enable = true;
|
|
name = "fix-byte-order-marker";
|
|
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/fix-byte-order-marker";
|
|
types = [ "text" ];
|
|
};
|
|
mixed-line-ending = {
|
|
enable = true;
|
|
name = "mixed-line-ending";
|
|
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/mixed-line-ending";
|
|
excludes = [ "png" ];
|
|
types = [ "text" ];
|
|
};
|
|
check-case-conflict = {
|
|
enable = true;
|
|
name = "check-case-conflict";
|
|
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/check-case-conflict";
|
|
types = [ "text" ];
|
|
};
|
|
detect-private-key = {
|
|
enable = true;
|
|
name = "detect-private-key";
|
|
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/detect-private-key";
|
|
types = [ "text" ];
|
|
};
|
|
|
|
# Starlark
|
|
# bazel-buildifier-format = {
|
|
# enable = true;
|
|
# name = "buildifier format";
|
|
# description = "Format Starlark";
|
|
# entry = "${pkgs.bazel-buildtools}/bin/buildifier";
|
|
# types = [ "bazel" ];
|
|
# };
|
|
# bazel-buildifier-lint = {
|
|
# enable = true;
|
|
# name = "buildifier lint";
|
|
# description = "Lint Starlark";
|
|
# entry = "${pkgs.bazel-buildtools}/bin/buildifier -lint=warn";
|
|
# types = [ "bazel" ];
|
|
# };
|
|
|
|
# YAML
|
|
# yamllint = {
|
|
# enable = true;
|
|
# };
|
|
|
|
# Nix
|
|
nixpkgs-fmt.enable = true;
|
|
|
|
# Markdown
|
|
# markdownlint = {
|
|
# enable = true;
|
|
# types = [ "markdown" ];
|
|
# };
|
|
}
|