Comments (8)
Sounds great!
And then we need to get nushell somehow in the CI and run the self-contained scripts looking for failures.
Random but I recently implemented nu scripting in a project so I can provide one answer to this question.
In an Alpine edge environment:
apk add nushell --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
I needed to use alpine:edge
because of nushell's git dependency.
from nu_scripts.
I'm fine with a two phased approach.
Phase 1: Add scripts
Phase 2: CI
I'm just not sure what we can test. I'm not sure I care about extra spaces. I mean, it would be nice to trim the lines of trailing whitespace but I'm not sure it's critical.
I'd really like to test every script so that when CI fails, we know that nushell changed. For instance, recently we changed count
to length
. Those scripts that still have count
should fail on the latest main. But we can't test all scripts. Maybe we should just have a test suite file where we add particular files to one master file that can be tested without outside intervention?
from nu_scripts.
I also like your idea to give credit where it's due on one-liners. Good job!
from nu_scripts.
I mean, it would be nice to trim the lines of trailing whitespace but I'm not sure it's critical.
Agreed. I seek out errant whitespace to remove it. So entirely personal.
But we can't test all scripts. Maybe we should just have a test suite file where we add particular files to one master file that can be tested without outside intervention?
This is a great point.
I think establishing what we can test and how is critical.
It seems to me that two broad categories emerge for oneliners: self-contained and those with external dependencies.
I also feel like that connects to the problem of scripts for learning and teaching versus those for experts who know what they are looking at.
If we establish a convention for learning oneliners, we could better test them.
Maybe we should just have a test suite file where we add particular files to one master file that can be tested without outside intervention?
I love the idea to collect them into one so we can test and do more things with them.
But I would prefer a way to codify this by where we put the script or some kind of opt-in annotation in a comment.
from nu_scripts.
I love the idea to collect them into one so we can test and do more things with them.
But I would prefer a way to codify this by where we put the script or some kind of opt-in annotation in a comment.
I'm open to ideas but I was thinking something like text files.
self-contained.txt
script1.nu
script2.nu
script3.nu
external.txt
script4.nu
script5.nu
script6.nu
And then we need to get nushell somehow in the CI and run the self-contained
scripts looking for failures.
The external
scripts could be tested via a container given we have the necessary requirements like input.json
or some_database
or whatever, but that may be too big of a leap.
I prefer starting very simple and then submitting PRs over time to add complexity where it's necessary.
from nu_scripts.
I noticed some scripts are marked as executable and others are not.
Perhaps we could consider linting that user-facing scripts are marked as executable.
from nu_scripts.
@efx i'm on windows and none of them are marked as executable since that isn't a thing. :) For *nix I'm happy to accept a PR that does that or linting as you suggest.
from nu_scripts.
@fdncred ah, thanks for noting that; corrects my perspective on whether it is worth pursuing. My *nix bias creeping in 😄.
from nu_scripts.
Related Issues (20)
- micromamba support
- `use` of `parse-help` throws `nu::parser::expected_keyword` HOT 1
- Performance issues on man completions HOT 5
- How about nushell-completions? HOT 5
- Job.nu script no longer works HOT 2
- nu_conda list should show which environments are activated HOT 1
- Nuscript's for Pacman
- Module `rbenv` can't export command named same as module. HOT 3
- Add a basic level of CI for this repo HOT 3
- winget-completions.nu with problems? HOT 4
- Conda documentation HOT 3
- Admin commands Question HOT 1
- Fix: nushell at 0.88.0 `start` and `end` are deprecated HOT 1
- tokyo-night theme uses tokyo-storm palette HOT 7
- [new script] is dark_mode mac HOT 1
- The direnv hooks are very confusing HOT 1
- `main` branch CI is not working as expected HOT 1
- git branch cleanup returns errors. HOT 4
- PR 816 Broke Anaconda Activation Support on Windows
- 'winget show' errors on specific packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nu_scripts.