This PR updates the toolkit testing to:
* Determine whether to lint as a module or source file based on the
presence of any `export ` line in the file.
* Run `nu-check` on files before linting with `use <file>` or `source
<file>`
* Updates the environment variable to `TEST_METHOD` with options for
`ide-check` or `import-or-source`.
* Updates the default to `import-or-source` (was `ide-check`) to match
CI
* Removes environment variable from CI since this test method is now the
default.
With this in place we should have far fewer (false positive) failing CI
runs.
See
https://github.com/nushell/nu_scripts/pull/771#issuecomment-2020331739
and following
As we don't have a path forward to make sure all files are fixed and
will be maintained. (and the file detection itself is reliable)
Disable the `main` branch (and nightly run) for now.
This will keep the CI for PRs so at least added scripts pass the current
nu version
Closes#789🍻
- Runs without first generating a script
- Returns error (file) count
- Requires `--and-exit` to exit with error code
- Enables alternative report with env `STUB_IDE_CHECK=true`
- Expands documentation
- All subcommands share same file querying
- Prepares for nupm test integration
I made a `toolkit.nu` with a very bare bones struct, this is called via
[`setup-nu`](https://github.com/hustcer/setup-nu) action, and generates
the `check-files.nu` file. After that, another nu instance run that
script to check files one by one. The folder `before_v0.60/` is
excluded.
after running with this for a few months, i'm not really sure of the benefit since 99.9% of the changes are not files owned by codeowners. thanks @Hofer-Julian for helping test this!
* Add CODEOWNERS file
On its own, the only thing this does is request reviews from codeowners.
If virtual_environments is touched, @Hofer-Julian will be requested.
Otherwise, @fdncred.
Combined with branch protection rules, this can enforce who is allowed
to review and merge pull requests touching certain parts of the code.
* Add core team