Skip to content

Commit fcb7f9a

Browse files
committed
Adopt Project Manager
This also restricts the supported platforms to ones we have a chance of testing.
1 parent 7c20dba commit fcb7f9a

File tree

75 files changed

+1322
-597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1322
-597
lines changed

.cache/git/config

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.cache/git/hooks/pre-push

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.cache/vale/Vocab/categorifier/accept.txt

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/emacs/.dir-locals.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
((nil
2+
(fill-column . 100)
3+
(indent-tabs-mode . nil)
4+
(projectile-project-configure-cmd . "nix flake update")
5+
(sentence-end-double-space . nil)))

.config/mustache.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
project:
3+
{
4+
description: "Interpret Haskell programs into any cartesian closed category.",
5+
name: "categorifier",
6+
repo: "con-kitty/categorifier",
7+
summary: "Defining novel interpretations of Haskell programs",
8+
version: "0.1.0.0",
9+
},
10+
type: { name: "haskell" },
11+
}

.config/project/default.nix

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{config, flaky, lib, self, ...}: {
2+
project = {
3+
name = "categorifier";
4+
summary = "Defining novel interpretations of Haskell programs";
5+
};
6+
7+
imports = [
8+
./github-ci.nix
9+
./hlint.nix
10+
];
11+
12+
## dependency management
13+
services.renovate.enable = true;
14+
15+
## development
16+
programs = {
17+
direnv.enable = true;
18+
# This should default by whether there is a .git file/dir (and whether it’s
19+
# a file (worktree) or dir determines other things – like where hooks
20+
# are installed.
21+
git = {
22+
enable = true;
23+
ignores = [
24+
# Cabal build
25+
"dist-newstyle"
26+
];
27+
};
28+
};
29+
30+
## formatting
31+
editorconfig.enable = true;
32+
project.file.".dir-locals.el".source = lib.mkForce ../emacs/.dir-locals.el;
33+
programs = {
34+
treefmt = {
35+
enable = true;
36+
## Haskell formatter
37+
programs.ormolu.enable = true;
38+
};
39+
vale = {
40+
enable = true;
41+
excludes = [
42+
"*.cabal"
43+
"*.hs"
44+
"*.lhs"
45+
"./cabal.project"
46+
];
47+
vocab.${config.project.name}.accept = [
48+
"bugfix"
49+
"Categorifier"
50+
"categorified"
51+
"categorify"
52+
"comonad"
53+
"Conal"
54+
"concat"
55+
"conditionalize"
56+
"functor"
57+
"GADT"
58+
"GHC"
59+
"Hask"
60+
"inline"
61+
"inlining"
62+
"invasive"
63+
"Kleisli"
64+
"Kmett"
65+
"[Mm]onoidal"
66+
"monomorphization"
67+
"pragma"
68+
"unfolding"
69+
];
70+
};
71+
};
72+
73+
## CI
74+
services.garnix = {
75+
enable = true;
76+
builds.exclude = [
77+
# TODO: Remove once garnix-io/issues#17 is fixed.
78+
"devShells.aarch64-darwin.ghc928"
79+
# TODO: Remove once garnix-io/garnix#285 is fixed.
80+
"homeConfigurations.x86_64-darwin-${config.project.name}-example"
81+
];
82+
};
83+
## FIXME: Shouldn’t need `mkForce` here (or to duplicate the base contexts).
84+
## Need to improve module merging.
85+
services.github.settings.branches.main.protection.required_status_checks.contexts =
86+
lib.mkForce
87+
(map (ghc: "CI / build (${ghc}) (pull_request)") self.lib.nonNixTestedGhcVersions
88+
++ lib.concatMap flaky.lib.garnixChecks (
89+
lib.concatMap (ghc: [
90+
(sys: "devShell ghc${ghc} [${sys}]")
91+
(sys: "package ghc${sys}_all [${sys}]")
92+
])
93+
self.lib.testedGhcVersions
94+
++ [
95+
(sys: "homeConfig ${sys}-${config.project.name}-example")
96+
(sys: "package default [${sys}]")
97+
## FIXME: These are duplicated from the base config
98+
(sys: "check formatter [${sys}]")
99+
(sys: "devShell default [${sys}]")
100+
]));
101+
102+
## publishing
103+
services.flakehub.enable = true;
104+
services.github.enable = true;
105+
services.github.settings.repository.topics = ["category-theory" "plugin"];
106+
}

.config/project/github-ci.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{lib, self, ...}: {
2+
services.github.workflow."build.yml".text = lib.generators.toYAML {} {
3+
name = "CI";
4+
on = {
5+
push.branches = ["main"];
6+
pull_request.types = [
7+
"opened"
8+
"synchronize"
9+
];
10+
};
11+
jobs.build = {
12+
runs-on = "ubuntu-latest";
13+
strategy = {
14+
fail-fast = false;
15+
## TODO: Populate this as the difference between supported versions and
16+
## available nix package sets.
17+
matrix.ghc = self.lib.nonNixTestedGhcVersions;
18+
};
19+
env.CONFIG = "--enable-tests --enable-benchmarks";
20+
steps = [
21+
{uses = "actions/checkout@v2";}
22+
{
23+
uses = "haskell-actions/setup@v2";
24+
id = "setup-haskell-cabal";
25+
"with" = {
26+
ghc-version = "\${{ matrix.ghc }}";
27+
cabal-version = "3.10";
28+
};
29+
}
30+
{run = "cabal v2-update";}
31+
{run = "cabal v2-freeze $CONFIG";}
32+
{
33+
uses = "actions/cache@v2";
34+
"with" = {
35+
path = ''
36+
''${{ steps.setup-haskell-cabal.outputs.cabal-store }}
37+
dist-newstyle
38+
'';
39+
key = "\${{ runner.os }}-\${{ matrix.ghc }}-\${{ hashFiles('cabal.project.freeze') }}";
40+
};
41+
}
42+
{run = "cabal v2-test all $CONFIG";}
43+
];
44+
};
45+
};
46+
}

.config/project/hlint.nix

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{lib, pkgs, ...}: {
2+
## Haskell linter
3+
programs.treefmt.programs.hlint.enable = true;
4+
## TODO: Wrap this to find our generated hlint config in the store.
5+
project.devPackages = [pkgs.hlint];
6+
project.file.".hlint.yaml".text = lib.generators.toYAML {} [
7+
{fixity = "infixl 4 <*\>";}
8+
{fixity = "infixr 1 =<\<";}
9+
{fixity = "infixr 1 <=\<";}
10+
11+
{group = {name = "dollar"; enabled = true;};}
12+
{group = {name = "future"; enabled = true;};}
13+
{group = {name = "generalise"; enabled = true;};}
14+
15+
{ignore = {name = "Eta reduce";};}
16+
{ignore = {name = "Evaluate";};}
17+
{ignore = {name = "Reduce duplication";};}
18+
{ignore = {name = "Use list comprehension";};}
19+
{ignore = {name = "Use section";};}
20+
21+
{
22+
package = {
23+
name = "monad";
24+
modules = ["import Control.Monad"];
25+
};
26+
}
27+
28+
{
29+
package = {
30+
name = "traversable";
31+
modules = [
32+
"import Data.Foldable"
33+
"import Data.Traversable"
34+
];
35+
};
36+
}
37+
38+
{
39+
group = {
40+
name = "generalize";
41+
imports = [
42+
"package monad"
43+
"package traversable"
44+
];
45+
rules = [
46+
{warn = {lhs = "forM"; rhs = "for";};}
47+
{warn = {lhs = "forM_"; rhs = "for_";};}
48+
{warn = {lhs = "map"; rhs = "fmap";};}
49+
{warn = {lhs = "mapM"; rhs = "traverse";};}
50+
{warn = {lhs = "mapM_"; rhs = "traverse_";};}
51+
{warn = {lhs = "return"; rhs = "pure";};}
52+
{warn = {lhs = "sequence"; rhs = "sequenceA";};}
53+
{warn = {lhs = "sequence_"; rhs = "sequenceA_";};}
54+
];
55+
};
56+
}
57+
58+
{
59+
group = {
60+
name = "generalize";
61+
imports = ["package traversable"];
62+
rules = [
63+
{
64+
hint = {
65+
lhs = "maybe (pure ())";
66+
rhs = "traverse_";
67+
note = "IncreasesLaziness";
68+
};
69+
}
70+
{warn = {lhs = "mappend"; rhs = "(<>)";};}
71+
{warn = {lhs = "(++)"; rhs = "(<>)";};}
72+
];
73+
};
74+
}
75+
];
76+
}

.dir-locals.el

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.editorconfig

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)