Commit Graph
109 Commits
Author SHA1 Message Date
Matt Sturgeon 990ef039f7 tests: move test derivations to tests/default.nix
Move the previous `default.nix` to `main.nix` so that `default.nix` can
be used for defining the set of all test derivations.

`main.nix` is imported by `default.nix`, but is only responsible for the
tests built from `tests/test-sources/`.
2024-10-18 20:51:30 +01:00
Matt Sturgeon af650ba940 tests/lsp-servers: de-couple from grouped tests
Follow up to cab6b0c9fe
2024-10-10 21:50:23 +01:00
Austin Horstman b4f71a9330 flake-modules/dev: exclude generated files from typos hook 2024-10-10 09:35:52 -05:00
Matt Sturgeon 4b7a41276a modules/nixpkgs: initial pkgs option, drop defaultPkgs specialArg
This minimal implementation allows `nixpkgs.pkgs` to be defined, but
does not implement evaluating an instance from a pkgsPath when _not_
defined.

The `defaultPkgs` specialArg is dropped in favour of `nixpkgs.pkgs`
being defined. If it's not defined, an assertion is thrown.

In the future, a nixpkgs source path can be supplied, defaulting to the
flake's `inputs.nixpkgs`. Along with other `nixpkgs.*` options, this
will allow a `pkgs` instance to be evaluated within the module eval.
2024-09-27 09:30:12 +01:00
Matt Sturgeon 6a1bf6bdc3 modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00
Austin Horstman 5e8f822af5 flake-modules/dev: treefmt re-enable taplo linux 2024-09-26 11:05:48 -05:00
Matt Sturgeon 191b0a9502 treewide: avoid passing pkgs to our lib
In the two places where our "helpers" lib is exclusively internal
(flake module args and building the docs), we no longer supply `pkgs`.

In the other 4 locations, we now note why we still do in a comment.
2024-09-22 18:18:05 +01:00
Matt Sturgeon fcb782cd9c flake: add an empty nixvimConfiguration to the legacyPackages output 2024-09-15 18:59:52 +01:00
Matt Sturgeon 4e5bd1d79b lib: segregate and deprecate functions that need pkgs
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.

This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
  and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
  to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
  evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
  final lib.
2024-09-13 19:05:26 +01:00
Matt Sturgeon 7a147234f8 lib: rename helpers.nix -> default.nix
The old `default.nix` is inlined into the "lib" flake-module, which is
the only place it was used.

This allows "helpers" to take its rightful place at the root of `./lib` 👑
2024-09-13 17:25:17 +01:00
Matt SturgeonandAustin Horstman 1310eaf606 flake/treefmt: disable taplo for now
It is currently broken, with the error:

taplo with options '[format]' failed to apply: exit status 101
2024-09-13 10:08:08 -05:00
Quentin BoyerandMatt Sturgeon cab2a30ae1 docs: Create a markdown-it plugin 2024-09-13 12:59:27 +01:00
Matt Sturgeon 6665521525 docs: move pkgs overlays to their own file 2024-09-13 12:26:48 +01:00
Matt Sturgeon faff32b9f1 plugins/by-name: init
Add support for automatically importing any directories under
`plugins/by-name`.

Includes a validation test, which is run by CI and by the pre-commit hook.
2024-09-09 11:50:38 +01:00
Matt Sturgeon c4135d720a flake/pre-commit: check maintainers when modified 2024-09-07 02:08:23 +01:00
Matt Sturgeon 5c929a161f flake: remove pre-commit from checks output 2024-09-07 02:08:23 +01:00
Matt Sturgeon e48da949cf tests/package-options: init
The test ensures "package" options use a "literalExpression" in their
defaultText; i.e. it validates `lib.mkPackageOption` was used to build
the package options.

All options whose `default` is a derivation are covered by the test,
other than submodule sub-options.
2024-09-05 02:24:52 +01:00
Austin Horstman caefb266be flake-modules/dev: treefmt ignore .editorconfig 2024-08-31 16:26:49 -05:00
Matt Sturgeon 1c879ec3aa tests: add regression test for warnings + assertions
Ensure `mkTestDerivationFromNixvimModule` correctly test warnings & assertions.

Also did some minor cleanup:
- Call `failing-tests.nix` using `pkgs.callPackage`
- Replace repetive use of `testBuildFailure` with a wrapper
  `mkFailingNixvimTest`
2024-08-28 00:44:34 +01:00
Matt Sturgeon 60ea38d2c4 tests: test the tests
Adds a regression test for #2076. This test ensures that
`extraConfigLua` is used in `finalPackage` and that the test will fail
correctly when running `nvim` results in unexpected output.
2024-08-27 03:54:43 +01:00
Austin Horstman 45081d5f21 flake-modules/list-plugins: add extra filters
I have been using this more and wanted to create some filters to
onlyoutput the information I cared about. This adds the ability to
filter bykind, state, and whether a plugin has deprecation warnings.
2024-08-24 09:39:29 -05:00
Austin Horstman 3a04cc75e6 flake-modules/dev: add isort 2024-08-24 08:47:04 -05:00
Matt Sturgeon cbd1003d9d modules/test: move test derivation to an option
Introduced the `test.derivation` read-only option.
2024-08-21 02:48:00 +01:00
Matt Sturgeon f47374fd26 modules/test: init, replacing dontRun arg
Introduces the `test.runNvim` module option.

Deprecates the historic `dontRun` argument passed to the test-derivation
helpers.

Soft-deprecates the `tests.dontRun` attr used in tests currently.
2024-08-20 00:34:12 +01:00
Matt Sturgeon 312db6b6e2 flake-modules/devshell: update tests command with link-farm support
Since we're using link-farms, we need to access the underlying tests as
`passthru.entries.*`.
2024-08-19 03:57:22 +01:00
Austin Horstman fb4e6c2361 flake-modules/devshell: add getopt runtimeInput
Use a consistent behavior of getopt in launchtests.sh. Wasn't able to
use tests command on macbook without including this because the macOS
getopt didn't support our usage.
2024-08-15 08:02:57 -05:00
Matt Sturgeon d3cb750e6a update-scripts: move out of flake
See the explanation in the new update-scripts/README.md file.
2024-08-03 21:56:40 +01:00
Matt Sturgeon 8945b3b5e3 flake/generate-files: fix --commit line count
`echo` pipes all its output at once, so `wc -l` always counts 1 line.

See https://stackoverflow.com/questions/60954221
2024-07-31 14:06:49 +01:00
Stanislav AsunkinandGaetanLepage 44849233e0 modules/performance: add ability to byte compile lua configuration files
This commit adds support for byte compiling lua configuration files.
It's enabled by default (if byte compiling is enabled at all) and can be
disabled with `performance.byteCompileLua.configs` toggle.

To implement this feature `extraFiles.<name>.finalSource` internal
read-only option is introduced. `source` option cannot be used because
it's user configurable. In order to access the values of the
`performance.byteCompileLua` options, parent config is added to
specialArgs of extraFiles submodule. Then the usages of `source` option
changed to `finalSource` in all relevant places (filesPlugin and
wrappers).

Added more helpers for various cases of byte compiling:

* `byteCompileLuaFile` byte compiles lua file
* `byteCompileLuaHook` is a setup hook that byte compiles all lua files
* `byteCompileLuaDrv` overrides derivation by adding byteCompileLuaHook
  to it

Added tests to validate that extraFiles specified by various methods are
handled correctly. Added a separate home-manager test, that is intended
to validate that extraFiles propagated to wrapper modules are correctly
byte compiled.
2024-07-31 11:31:40 +00:00
Matt Sturgeon 3789c69658 flake/generate-files: use nixfmt directly
Running `nix fmt` is unnecessary in this case.
2024-07-31 11:49:28 +01:00
Matt Sturgeon 0b23a4ce85 flake/generate-files: do all builds in one eval 2024-07-31 11:49:28 +01:00
Matt Sturgeon fc8155b5fa tests/generated: init by checking declared tools
This moves most assertions out of generate-files and into a check
derivation. This should allow the CI to finish, even when there are
issues.

This also properly tests efmls, which was only checked partially before.

rust-analyzer is not covered because the existing assertions relate more
to edge-cases not handled by the generation script than the result it
builds.
2024-07-31 11:49:28 +01:00
Quentin BoyerandGaetanLepage c12e59ff7c doc: Use correct href for nuscht-search
This commit also adds a subdirectory in the docs derivation, to have the
same local structure than what is uploaded on github pages.
2024-07-25 18:23:47 +00:00
Quentin BoyerandGaetanLepage 4d874f6c11 dev: Make the serve-docs command uncached 2024-07-25 14:00:35 +00:00
traxysandGaetanLepage 42a7676d5a docs: Add an option search to our documentation 2024-07-25 14:00:35 +00:00
traxys f1eaf5b617 dev: Allow to pass arguments to nix in tests
This can allow to pass --show-trace for example
2024-07-23 22:03:42 +02:00
traxys 1c75b414cb dev: Allow to choose the system in tests
This is done through the -s/--system <system> option
2024-07-23 21:58:23 +02:00
Gaetan LepageandGaétan Lepage 901e8760d0 flake-modules/dev: format launch-test.sh 2024-07-22 23:25:28 +02:00
traxys 7908729711 dev: Make the tests command able to select which test to launch
The `tests` command can either launch all tests (without any arguments),
a specific test with `-t/--test` or choose a test with `-i/--interactive`
2024-07-21 15:17:17 +02:00
traxys b1576362a7 tests: Remove the test link farm
Fixes #1878
2024-07-21 15:17:17 +02:00
Matt Sturgeon c1feceda64 dev: fix --commit when the worktree is dirty 2024-07-15 12:11:28 +01:00
Matt Sturgeon 4f3cd9f368 plugins/none-ls: combine packaged+unpackaged lists
We can just make `packaged` nullable again.
2024-07-13 20:20:46 +01:00
Gaetan LepageandGaétan Lepage ca01a644ef flake/dev/formatting: run ruff format in isolated mode 2024-07-11 14:59:08 +02:00
Matt Sturgeon 34c3c026b4 tests: add check for nixpkgs maintainers
The test fails if a nixvim maintainer is also a nixpkgs maintainer.
2024-07-10 09:18:18 +01:00
Matt Sturgeon 7e3d629bb0 flake/generate-files: add --commit command + fixes
- Added `--commit` with a git-based message
- `nix fmt` only operates on files known to git
- ensure `generated` directory exists
2024-07-10 08:30:03 +01:00
Matt SturgeonandGaetanLepage aad2e32b5a treewide: reformat 2024-07-08 16:24:47 +00:00
Matt SturgeonandGaetanLepage 3c786ae988 flake: ignore unformatted files
This suppresses treefmt's "no formatter for path" warnings.
2024-07-08 16:24:47 +00:00
Matt SturgeonandGaetanLepage f1a0cf3a90 flake: format toml using "taplo" 2024-07-08 16:24:47 +00:00
Matt SturgeonandGaetanLepage 2339ddc3a0 flake: format lua with "stylua" 2024-07-08 16:24:47 +00:00
Matt SturgeonandGaetanLepage b310affef3 flake: format + lint python with "ruff" 2024-07-08 16:24:46 +00:00