2023-08-27 07:48:57 +02:00
|
|
|
# flakelight -- Framework for simplifying flake setup
|
2023-08-25 06:14:55 +02:00
|
|
|
# Copyright (C) 2023 Archit Gupta <archit@accelbread.com>
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
{ config, lib, src, ... }:
|
|
|
|
let
|
|
|
|
inherit (lib) mkEnableOption mkIf optionalString pathExists;
|
|
|
|
in
|
|
|
|
{
|
2023-08-27 07:48:57 +02:00
|
|
|
options.flakelight.editorconfig =
|
2023-08-25 06:14:55 +02:00
|
|
|
mkEnableOption "editorconfig check" // { default = true; };
|
|
|
|
|
|
|
|
config.checks = mkIf
|
2023-08-27 07:48:57 +02:00
|
|
|
(config.flakelight.editorconfig && (pathExists (src + /.editorconfig)))
|
2023-08-25 06:14:55 +02:00
|
|
|
{
|
|
|
|
# By default, high false-positive flags are disabled.
|
|
|
|
editorconfig = { editorconfig-checker, ... }:
|
|
|
|
"${editorconfig-checker}/bin/editorconfig-checker"
|
|
|
|
+ optionalString (!pathExists (src + /.ecrc))
|
|
|
|
" -disable-indent-size -disable-max-line-length";
|
|
|
|
};
|
|
|
|
}
|