mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-20 07:17:50 +03:00
Merge pull request #1392 from rtfeldman/edit
Add a CI step to verify no untracked git changes
This commit is contained in:
commit
571401f0ca
12
Earthfile
12
Earthfile
@ -110,12 +110,24 @@ test-rust:
|
||||
RUN --mount=type=cache,target=$SCCACHE_DIR \
|
||||
cargo test --release && sccache --show-stats
|
||||
|
||||
verify-no-git-changes:
|
||||
FROM +test-rust
|
||||
# If running tests caused anything to be changed or added (without being
|
||||
# included in a .gitignore somewhere), fail the build!
|
||||
#
|
||||
# How it works: the `git ls-files` command lists all the modified or
|
||||
# uncommitted files in the working tree, the `| grep -E .` command returns a
|
||||
# zero exit code if it listed any files and nonzero otherwise (which is the
|
||||
# opposite of what we want), and the `!` at the start inverts the exit code.
|
||||
RUN ! git ls-files --deleted --modified --others --exclude-standard | grep -E .
|
||||
|
||||
test-all:
|
||||
BUILD +test-zig
|
||||
BUILD +check-rustfmt
|
||||
BUILD +check-clippy
|
||||
BUILD +check-typos
|
||||
BUILD +test-rust
|
||||
BUILD +verify-no-git-changes
|
||||
|
||||
bench-roc:
|
||||
FROM +copy-dirs-and-cache
|
||||
|
@ -30,7 +30,7 @@ pub const DIRECTORY_OR_FILES: &str = "DIRECTORY_OR_FILES";
|
||||
pub const ARGS_FOR_APP: &str = "ARGS_FOR_APP";
|
||||
|
||||
pub fn build_app<'a>() -> App<'a> {
|
||||
App::new("roc")
|
||||
let app = App::new("roc")
|
||||
.version(crate_version!())
|
||||
.subcommand(App::new(CMD_BUILD)
|
||||
.about("Build a program")
|
||||
@ -81,15 +81,6 @@ pub fn build_app<'a>() -> App<'a> {
|
||||
.subcommand(App::new(CMD_REPL)
|
||||
.about("Launch the interactive Read Eval Print Loop (REPL)")
|
||||
)
|
||||
.subcommand(App::new(CMD_EDIT)
|
||||
.about("Launch the Roc editor")
|
||||
.arg(Arg::with_name(DIRECTORY_OR_FILES)
|
||||
.index(1)
|
||||
.multiple(true)
|
||||
.required(false)
|
||||
.help("(optional) The directory or files to open on launch.")
|
||||
)
|
||||
)
|
||||
.subcommand(
|
||||
App::new(CMD_DOCS)
|
||||
.about("Generate documentation for Roc modules")
|
||||
@ -100,7 +91,21 @@ pub fn build_app<'a>() -> App<'a> {
|
||||
.help("The directory or files to build documentation for")
|
||||
|
||||
)
|
||||
);
|
||||
|
||||
if cfg!(feature = "edit") {
|
||||
app.subcommand(
|
||||
App::new(CMD_EDIT).about("Launch the Roc editor").arg(
|
||||
Arg::with_name(DIRECTORY_OR_FILES)
|
||||
.index(1)
|
||||
.multiple(true)
|
||||
.required(false)
|
||||
.help("(optional) The directory or files to open on launch."),
|
||||
),
|
||||
)
|
||||
} else {
|
||||
app
|
||||
}
|
||||
}
|
||||
|
||||
pub fn docs(files: Vec<PathBuf>) {
|
||||
|
Loading…
Reference in New Issue
Block a user