repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/executor.rs | src/executor.rs | use super::*;
pub(crate) enum Executor<'a> {
Command(Interpreter<String>),
Shebang(Shebang<'a>),
}
impl Executor<'_> {
pub(crate) fn command<'src>(
&self,
config: &Config,
path: &Path,
recipe: &'src str,
working_directory: Option<&Path>,
) -> RunResult<'src, Command> {
match self {
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/format_string_part.rs | src/format_string_part.rs | #[derive(PartialEq, Debug, Clone, Ord, Eq, PartialOrd)]
pub(crate) enum FormatStringPart {
Continue,
End,
Single,
Start,
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/testing.rs | src/testing.rs | use {super::*, pretty_assertions::assert_eq};
pub(crate) fn compile(src: &str) -> Justfile {
Compiler::test_compile(src).expect("expected successful compilation")
}
pub(crate) fn config(args: &[&str]) -> Config {
let mut args = Vec::from(args);
args.insert(0, "just");
let app = Config::app();
let matches ... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/compile_error_kind.rs | src/compile_error_kind.rs | use super::*;
#[derive(Debug, PartialEq)]
pub(crate) enum CompileErrorKind<'src> {
ArgAttributeValueRequiresOption,
ArgumentPatternRegex {
source: regex::Error,
},
AttributeArgumentCountMismatch {
attribute: Name<'src>,
found: usize,
min: usize,
max: usize,
},
AttributeKeyMissingValue {... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/compilation.rs | src/compilation.rs | use super::*;
#[derive(Debug)]
pub(crate) struct Compilation<'src> {
pub(crate) asts: HashMap<PathBuf, Ast<'src>>,
pub(crate) justfile: Justfile<'src>,
pub(crate) root: PathBuf,
pub(crate) srcs: HashMap<PathBuf, &'src str>,
}
impl<'src> Compilation<'src> {
pub(crate) fn root_ast(&self) -> &Ast<'src> {
s... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/verbosity.rs | src/verbosity.rs | #[allow(clippy::arbitrary_source_item_ordering)]
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
pub(crate) enum Verbosity {
Quiet,
Taciturn,
Loquacious,
Grandiloquent,
}
impl Verbosity {
pub(crate) fn from_flag_occurrences(flag_occurrences: u8) -> Self {
match flag_occurrences {
0 => Self::Ta... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/run.rs | src/run.rs | use super::*;
/// Main entry point into `just`. Parse arguments from `args` and run.
#[allow(clippy::missing_errors_doc)]
pub fn run(args: impl Iterator<Item = impl Into<OsString> + Clone>) -> Result<(), i32> {
#[cfg(windows)]
ansi_term::enable_ansi_support().ok();
let app = Config::app();
let matches = app.... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/alias.rs | src/alias.rs | use super::*;
/// An alias, e.g. `alias name := target`
#[derive(Debug, PartialEq, Clone, Serialize)]
pub(crate) struct Alias<'src, T = Arc<Recipe<'src>>> {
pub(crate) attributes: AttributeSet<'src>,
pub(crate) name: Name<'src>,
#[serde(
bound(serialize = "T: Keyed<'src>"),
serialize_with = "keyed::seria... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/condition.rs | src/condition.rs | use super::*;
#[derive(PartialEq, Debug, Clone)]
pub(crate) struct Condition<'src> {
pub(crate) lhs: Box<Expression<'src>>,
pub(crate) operator: ConditionalOperator,
pub(crate) rhs: Box<Expression<'src>>,
}
impl Display for Condition<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{} {}... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/completions.rs | src/completions.rs | use super::*;
#[derive(ValueEnum, Debug, Clone, Copy, PartialEq)]
pub(crate) enum Shell {
Bash,
Elvish,
Fish,
#[value(alias = "nu")]
Nushell,
Powershell,
Zsh,
}
impl Shell {
pub(crate) fn script(self) -> &'static str {
match self {
Self::Bash => include_str!("../completions/just.bash"),
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/loader.rs | src/loader.rs | use super::*;
pub(crate) struct Loader {
paths: Arena<PathBuf>,
srcs: Arena<String>,
}
impl Loader {
pub(crate) fn new() -> Self {
Self {
srcs: Arena::new(),
paths: Arena::new(),
}
}
pub(crate) fn load<'src>(
&'src self,
root: &Path,
path: &Path,
) -> RunResult<'src, (&'sr... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/enclosure.rs | src/enclosure.rs | use super::*;
pub struct Enclosure<T: Display> {
enclosure: &'static str,
value: T,
}
impl<T: Display> Enclosure<T> {
pub fn tick(value: T) -> Enclosure<T> {
Self {
enclosure: "`",
value,
}
}
}
impl<T: Display> Display for Enclosure<T> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/shebang.rs | src/shebang.rs | #[derive(Copy, Clone)]
pub(crate) struct Shebang<'line> {
pub(crate) argument: Option<&'line str>,
pub(crate) interpreter: &'line str,
}
impl<'line> Shebang<'line> {
pub(crate) fn new(line: &'line str) -> Option<Self> {
if !line.starts_with("#!") {
return None;
}
let mut pieces = line[2..]
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/namepath.rs | src/namepath.rs | use super::*;
#[derive(Clone, Debug, PartialEq, Eq, Ord, PartialOrd)]
pub(crate) struct Namepath<'src>(Vec<Name<'src>>);
impl<'src> Namepath<'src> {
pub(crate) fn join(&self, name: Name<'src>) -> Self {
Self(self.0.iter().copied().chain(iter::once(name)).collect())
}
pub(crate) fn push(&mut self, name: Nam... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/range_ext.rs | src/range_ext.rs | use super::*;
pub(crate) trait RangeExt<T> {
fn display(&self) -> DisplayRange<&Self> {
DisplayRange(self)
}
}
pub(crate) struct DisplayRange<T>(T);
impl Display for DisplayRange<&RangeInclusive<usize>> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
if self.0.start() == self.0.end() {
write!... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/arg_attribute.rs | src/arg_attribute.rs | use super::*;
pub(crate) struct ArgAttribute<'src> {
pub(crate) help: Option<String>,
pub(crate) long: Option<String>,
pub(crate) name: Token<'src>,
pub(crate) pattern: Option<Pattern<'src>>,
pub(crate) short: Option<char>,
pub(crate) value: Option<String>,
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/name.rs | src/name.rs | use super::*;
/// A name. This is just a `Token` of kind `Identifier`, but we give it its own
/// type for clarity.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)]
pub(crate) struct Name<'src> {
pub(crate) token: Token<'src>,
}
impl<'src> Name<'src> {
pub(crate) fn from_identifier(token: Token<'src>... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/interpreter.rs | src/interpreter.rs | use super::*;
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)]
pub(crate) struct Interpreter<T> {
pub(crate) arguments: Vec<T>,
pub(crate) command: T,
}
impl Interpreter<String> {
pub(crate) fn default_script_interpreter() -> &'static Self {
static INSTANCE: LazyLock<Interpreter<String>> =... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/unresolved_recipe.rs | src/unresolved_recipe.rs | use super::*;
pub(crate) type UnresolvedRecipe<'src> = Recipe<'src, UnresolvedDependency<'src>>;
impl<'src> UnresolvedRecipe<'src> {
pub(crate) fn resolve(
self,
module_path: &str,
resolved: Vec<Arc<Recipe<'src>>>,
) -> CompileResult<'src, Recipe<'src>> {
assert_eq!(
self.dependencies.len(),... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/main.rs | src/main.rs | fn main() {
if let Err(code) = just::run(std::env::args_os()) {
std::process::exit(code);
}
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/constants.rs | src/constants.rs | use super::*;
const CONSTANTS: &[(&str, &str, Option<&str>, &str)] = &[
("HEX", "0123456789abcdef", None, "1.27.0"),
("HEXLOWER", "0123456789abcdef", None, "1.27.0"),
("HEXUPPER", "0123456789ABCDEF", None, "1.27.0"),
("PATH_SEP", "/", Some("\\"), "1.41.0"),
("PATH_VAR_SEP", ":", Some(";"), "1.41.0"),
("CLE... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/ordinal.rs | src/ordinal.rs | pub(crate) trait Ordinal {
/// Convert an index starting at 0 to an ordinal starting at 1
fn ordinal(self) -> Self;
}
impl Ordinal for usize {
fn ordinal(self) -> Self {
self + 1
}
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/binding.rs | src/binding.rs | use super::*;
/// A binding of `name` to `value`
#[derive(Debug, Clone, PartialEq, Serialize)]
pub(crate) struct Binding<'src, V = String> {
pub(crate) export: bool,
#[serde(skip)]
pub(crate) file_depth: u32,
pub(crate) name: Name<'src>,
#[serde(skip)]
pub(crate) prelude: bool,
pub(crate) private: bool,
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/request.rs | src/request.rs | use super::*;
#[derive(Clone, Debug, Deserialize, PartialEq)]
#[serde(rename_all = "kebab-case")]
pub enum Request {
EnvironmentVariable(String),
#[cfg(not(windows))]
Signal,
}
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum Response {
EnvironmentVariable(Optio... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/line.rs | src/line.rs | use super::*;
/// A single line in a recipe body, consisting of any number of `Fragment`s.
#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(transparent)]
pub(crate) struct Line<'src> {
pub(crate) fragments: Vec<Fragment<'src>>,
#[serde(skip)]
pub(crate) number: usize,
}
impl Line<'_> {
fn first(&self) ->... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/item.rs | src/item.rs | use super::*;
/// A single top-level item
#[derive(Debug, Clone)]
pub(crate) enum Item<'src> {
Alias(Alias<'src, Namepath<'src>>),
Assignment(Assignment<'src>),
Comment(&'src str),
Import {
absolute: Option<PathBuf>,
optional: bool,
relative: StringLiteral<'src>,
},
Module {
absolute: Optio... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/position.rs | src/position.rs | /// Source position
#[derive(Copy, Clone, PartialEq, Debug)]
pub(crate) struct Position {
pub(crate) column: usize,
pub(crate) line: usize,
pub(crate) offset: usize,
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/setting.rs | src/setting.rs | use super::*;
#[derive(Debug, Clone)]
pub(crate) enum Setting<'src> {
AllowDuplicateRecipes(bool),
AllowDuplicateVariables(bool),
DotenvFilename(Expression<'src>),
DotenvLoad(bool),
DotenvOverride(bool),
DotenvPath(Expression<'src>),
DotenvRequired(bool),
Export(bool),
Fallback(bool),
IgnoreComment... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/thunk.rs | src/thunk.rs | use super::*;
#[allow(clippy::arbitrary_source_item_ordering)]
#[derive_where(Debug, PartialEq)]
#[derive(Clone)]
pub(crate) enum Thunk<'src> {
Nullary {
name: Name<'src>,
#[derive_where(skip(Debug, EqHashOrd))]
function: fn(function::Context) -> FunctionResult,
},
Unary {
name: Name<'src>,
#... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/evaluator.rs | src/evaluator.rs | use super::*;
pub(crate) struct Evaluator<'src: 'run, 'run> {
assignments: Option<&'run Table<'src, Assignment<'src>>>,
context: Option<ExecutionContext<'src, 'run>>,
is_dependency: bool,
non_const_assignments: Table<'src, Name<'src>>,
scope: Scope<'src, 'run>,
}
impl<'src, 'run> Evaluator<'src, 'run> {
f... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/module_path.rs | src/module_path.rs | use super::*;
#[derive(Debug, PartialEq, Clone)]
pub(crate) struct ModulePath {
pub(crate) path: Vec<String>,
pub(crate) spaced: bool,
}
impl TryFrom<&[&str]> for ModulePath {
type Error = ();
fn try_from(path: &[&str]) -> Result<Self, Self::Error> {
let spaced = path.len() > 1;
let path = if path.l... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/color.rs | src/color.rs | use {
super::*,
ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix},
std::io::{self, IsTerminal},
};
#[derive(Copy, Clone, Debug, PartialEq)]
pub(crate) struct Color {
is_terminal: bool,
style: Style,
use_color: UseColor,
}
impl Color {
pub(crate) fn active(&self) -> bool {
match self.us... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/positional.rs | src/positional.rs | use super::*;
/// A struct containing the parsed representation of positional command-line
/// arguments, i.e. arguments that are not flags, options, or the subcommand.
///
/// The DSL of positional arguments is fairly complex and mostly accidental.
/// There are three possible components: overrides, a search director... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/command_color.rs | src/command_color.rs | use super::*;
#[derive(Copy, Clone, ValueEnum)]
pub(crate) enum CommandColor {
Black,
Blue,
Cyan,
Green,
Purple,
Red,
Yellow,
}
impl From<CommandColor> for ansi_term::Color {
fn from(command_color: CommandColor) -> Self {
match command_color {
CommandColor::Black => Self::Black,
Comman... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/string_delimiter.rs | src/string_delimiter.rs | #[derive(Debug, PartialEq, Clone, Copy, Ord, PartialOrd, Eq)]
pub(crate) enum StringDelimiter {
Backtick,
QuoteDouble,
QuoteSingle,
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/assignment.rs | src/assignment.rs | use super::*;
/// An assignment, e.g `foo := bar`
pub(crate) type Assignment<'src> = Binding<'src, Expression<'src>>;
impl Display for Assignment<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
if self.private {
writeln!(f, "[private]")?;
}
if self.export {
write!(f, "export ")?;
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/set.rs | src/set.rs | use super::*;
#[derive(Debug, Clone)]
pub(crate) struct Set<'src> {
pub(crate) name: Name<'src>,
pub(crate) value: Setting<'src>,
}
impl<'src> Keyed<'src> for Set<'src> {
fn key(&self) -> &'src str {
self.name.lexeme()
}
}
impl Display for Set<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/signals.rs | src/signals.rs | use {
super::*,
nix::{
errno::Errno,
fcntl::{FcntlArg, FdFlag},
sys::signal::{SaFlags, SigAction, SigHandler, SigSet},
},
std::{
fs::File,
io::Read,
os::fd::{BorrowedFd, IntoRawFd, OwnedFd},
sync::atomic::{self, AtomicI32},
},
};
const INVALID_FILENO: i32 = -1;
static WRITE: Atom... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/suggestion.rs | src/suggestion.rs | use super::*;
#[derive(Clone, Copy, Debug, PartialEq)]
pub(crate) struct Suggestion<'src> {
pub(crate) name: &'src str,
pub(crate) target: Option<&'src str>,
}
impl Display for Suggestion<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "Did you mean `{}`", self.name)?;
if let Some(targ... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/switch.rs | src/switch.rs | use super::*;
#[derive(Debug, PartialEq)]
pub(crate) enum Switch {
Long(String),
Short(char),
}
impl Display for Switch {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match &self {
Self::Long(long) => write!(f, "--{long}"),
Self::Short(short) => write!(f, "-{short}"),
}
}
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/invocation_parser.rs | src/invocation_parser.rs | use super::*;
#[allow(clippy::doc_markdown)]
/// The invocation parser is responsible for grouping command-line positional
/// arguments into invocations, which consist of a recipe and its arguments.
///
/// Invocation parsing is substantially complicated by the fact that recipe
/// paths can be given on the command l... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/usage.rs | src/usage.rs | use super::*;
pub(crate) struct Usage<'a, D> {
pub(crate) long: bool,
pub(crate) path: &'a ModulePath,
pub(crate) recipe: &'a Recipe<'a, D>,
}
impl<D> ColorDisplay for Usage<'_, D> {
fn fmt(&self, f: &mut Formatter, color: Color) -> fmt::Result {
write!(
f,
"{}{}{} {}",
color
.he... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/parameter.rs | src/parameter.rs | use super::*;
#[derive(PartialEq, Debug, Clone, Serialize)]
pub(crate) struct Parameter<'src> {
pub(crate) default: Option<Expression<'src>>,
pub(crate) export: bool,
pub(crate) help: Option<String>,
pub(crate) kind: ParameterKind,
pub(crate) long: Option<String>,
pub(crate) name: Name<'src>,
pub(crate) ... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/token.rs | src/token.rs | use super::*;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)]
pub(crate) struct Token<'src> {
pub(crate) column: usize,
pub(crate) kind: TokenKind,
pub(crate) length: usize,
pub(crate) line: usize,
pub(crate) offset: usize,
pub(crate) path: &'src Path,
pub(crate) src: &'src str,
}
impl<'sr... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/compiler.rs | src/compiler.rs | use super::*;
pub(crate) struct Compiler;
impl Compiler {
pub(crate) fn compile<'src>(
config: &Config,
loader: &'src Loader,
root: &Path,
) -> RunResult<'src, Compilation<'src>> {
let mut asts = HashMap::<PathBuf, Ast>::new();
let mut loaded = Vec::new();
let mut paths = HashMap::<PathBuf... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/platform/unix.rs | src/platform/unix.rs | use super::*;
impl PlatformInterface for Platform {
fn make_shebang_command(
_config: &Config,
path: &Path,
_shebang: Shebang,
working_directory: Option<&Path>,
) -> Result<Command, OutputError> {
// shebang scripts can be executed directly on unix
let mut command = Command::new(path);
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/src/platform/windows.rs | src/platform/windows.rs | use super::*;
impl PlatformInterface for Platform {
fn make_shebang_command(
config: &Config,
path: &Path,
shebang: Shebang,
working_directory: Option<&Path>,
) -> Result<Command, OutputError> {
use std::borrow::Cow;
// If the path contains forward slashes…
let command = if shebang.int... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/allow_duplicate_recipes.rs | tests/allow_duplicate_recipes.rs | use super::*;
#[test]
fn allow_duplicate_recipes() {
Test::new()
.justfile(
"
b:
echo foo
b:
echo bar
set allow-duplicate-recipes
",
)
.stdout("bar\n")
.stderr("echo bar\n")
.run();
}
#[test]
fn allow_duplicate_recipes_with_args() {
Test::new()
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/quiet.rs | tests/quiet.rs | use super::*;
#[test]
fn no_stdout() {
Test::new()
.arg("--quiet")
.justfile(
r"
default:
@echo hello
",
)
.run();
}
#[test]
fn stderr() {
Test::new()
.arg("--quiet")
.justfile(
r"
default:
@echo hello 1>&2
",
)
.run();
}
#[test]
fn command_echoing() {
Test::new(... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/byte_order_mark.rs | tests/byte_order_mark.rs | use super::*;
#[test]
fn ignore_leading_byte_order_mark() {
Test::new()
.justfile(
"
\u{feff}foo:
echo bar
",
)
.stderr("echo bar\n")
.stdout("bar\n")
.run();
}
#[test]
fn non_leading_byte_order_mark_produces_error() {
Test::new()
.justfile(
"
foo:
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/misc.rs | tests/misc.rs | use super::*;
#[test]
fn alias_listing() {
Test::new()
.arg("--list")
.justfile(
"
foo:
echo foo
alias f := foo
",
)
.stdout(
"
Available recipes:
foo # [alias: f]
",
)
.run();
}
#[test]
fn alias_listing_with_doc() {
Test::new()
.justfile(
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | true |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/multibyte_char.rs | tests/multibyte_char.rs | use super::*;
#[test]
fn bugfix() {
Test::new().justfile("foo:\nx := '''ǩ'''").run();
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/ignore_comments.rs | tests/ignore_comments.rs | use super::*;
#[test]
fn ignore_comments_in_recipe() {
Test::new()
.justfile(
"
set ignore-comments
some_recipe:
# A recipe-internal comment
echo something-useful
",
)
.stdout("something-useful\n")
.stderr("echo something-useful\n")
.run();
}
#[test]
fn don... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/test.rs | tests/test.rs | use {
super::*,
pretty_assertions::{assert_eq, StrComparison},
};
pub(crate) struct Output {
pub(crate) pid: u32,
pub(crate) stdout: String,
pub(crate) tempdir: TempDir,
}
#[must_use]
pub(crate) struct Test {
pub(crate) args: Vec<String>,
pub(crate) current_dir: PathBuf,
pub(crate) env: BTreeMap<Strin... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/settings.rs | tests/settings.rs | use super::*;
#[test]
fn all_settings_allow_expressions() {
Test::new()
.justfile(
"
foo := 'hello'
set dotenv-filename := foo
set dotenv-path := foo
set script-interpreter := [foo, foo, foo]
set shell := [foo, foo, foo]
set tempdir := foo
set window... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/dotenv.rs | tests/dotenv.rs | use super::*;
#[test]
fn dotenv() {
Test::new()
.write(".env", "KEY=ROOT")
.write("sub/.env", "KEY=SUB")
.write("sub/justfile", "default:\n\techo KEY=${KEY:-unset}")
.args(["sub/default"])
.stdout("KEY=unset\n")
.stderr("echo KEY=${KEY:-unset}\n")
.run();
}
#[test]
fn set_false() {
Tes... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/no_exit_message.rs | tests/no_exit_message.rs | use super::*;
#[test]
fn recipe_exit_message_suppressed() {
Test::new()
.justfile(
"
# This is a doc comment
[no-exit-message]
hello:
@echo 'Hello, World!'
@exit 100
",
)
.stdout("Hello, World!\n")
.status(100)
.run();
}
#[test]
fn silent_recipe_exit... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/search_arguments.rs | tests/search_arguments.rs | use super::*;
#[test]
fn argument_with_different_path_prefix_is_allowed() {
Test::new()
.justfile("foo bar:")
.args(["./foo", "../bar"])
.run();
}
#[test]
fn passing_dot_as_argument_is_allowed() {
Test::new()
.justfile(
"
say ARG:
echo {{ARG}}
",
)
.write(
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/delimiters.rs | tests/delimiters.rs | use super::*;
#[test]
fn mismatched_delimiter() {
Test::new()
.justfile("(]")
.stderr(
"
error: Mismatched closing delimiter `]`. (Did you mean to close the `(` on line 1?)
——▶ justfile:1:2
│
1 │ (]
│ ^
",
)
.status(EXIT_FAILURE)
.run();
}
#[test]
fn unexpected_... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/imports.rs | tests/imports.rs | use super::*;
#[test]
fn import_succeeds() {
Test::new()
.tree(tree! {
"import.justfile": "
b:
@echo B
",
})
.justfile(
"
import './import.justfile'
a: b
@echo A
",
)
.arg("a")
.stdout("B\nA\n")
.run();
}
#[test]
fn mis... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/parameters.rs | tests/parameters.rs | use super::*;
#[test]
fn parameter_default_values_may_use_earlier_parameters() {
Test::new()
.justfile(
"
@foo a b=a:
echo {{ b }}
",
)
.args(["foo", "bar"])
.stdout("bar\n")
.run();
}
#[test]
fn parameter_default_values_may_not_use_later_parameters() {
Test::new(... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/global.rs | tests/global.rs | use super::*;
#[test]
#[cfg(target_os = "macos")]
fn macos() {
let tempdir = tempdir();
let path = tempdir.path().to_owned();
Test::with_tempdir(tempdir)
.no_justfile()
.test_round_trip(false)
.write(
"Library/Application Support/just/justfile",
"@default:\n echo foo",
)
.env("... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/lib.rs | tests/lib.rs | use {
crate::{
assert_stdout::assert_stdout,
assert_success::assert_success,
tempdir::tempdir,
test::{assert_eval_eq, Output, Test},
},
executable_path::executable_path,
just::{unindent, Response},
libc::{EXIT_FAILURE, EXIT_SUCCESS},
pretty_assertions::Comparison,
regex::Regex,
serde::{D... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/allow_duplicate_variables.rs | tests/allow_duplicate_variables.rs | use super::*;
#[test]
fn allow_duplicate_variables() {
Test::new()
.justfile(
"
a := 'foo'
a := 'bar'
set allow-duplicate-variables
b:
echo {{a}}
",
)
.arg("b")
.stdout("bar\n")
.stderr("echo bar\n")
.run();
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/command.rs | tests/command.rs | use super::*;
#[test]
fn long() {
Test::new()
.arg("--command")
.arg("printf")
.arg("foo")
.justfile(
"
x:
echo XYZ
",
)
.stdout("foo")
.run();
}
#[test]
fn short() {
Test::new()
.arg("-c")
.arg("printf")
.arg("foo")
.justfile(
"
x:
ech... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/unstable.rs | tests/unstable.rs | use super::*;
#[test]
fn set_unstable_true_with_env_var() {
for val in ["true", "some-arbitrary-string"] {
Test::new()
.justfile("# hello")
.args(["--fmt"])
.env("JUST_UNSTABLE", val)
.status(EXIT_SUCCESS)
.stderr_regex("Wrote justfile to `.*`\n")
.run();
}
}
#[test]
fn set... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/unexport.rs | tests/unexport.rs | use super::*;
#[test]
fn unexport_environment_variable_linewise() {
Test::new()
.justfile(
"
unexport JUST_TEST_VARIABLE
@recipe:
echo ${JUST_TEST_VARIABLE:-unset}
",
)
.env("JUST_TEST_VARIABLE", "foo")
.stdout("unset\n")
.run();
}
#[test]
fn unexport_environment_... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/slash_operator.rs | tests/slash_operator.rs | use super::*;
#[test]
fn once() {
Test::new()
.justfile("x := 'a' / 'b'")
.args(["--evaluate", "x"])
.stdout("a/b")
.run();
}
#[test]
fn twice() {
Test::new()
.justfile("x := 'a' / 'b' / 'c'")
.args(["--evaluate", "x"])
.stdout("a/b/c")
.run();
}
#[test]
fn no_lhs_once() {
Test:... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/man.rs | tests/man.rs | use super::*;
#[test]
fn output() {
Test::new()
.arg("--man")
.stdout_regex("(?s).*.TH just 1.*")
.run();
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/no_aliases.rs | tests/no_aliases.rs | use super::*;
#[test]
fn skip_alias() {
Test::new()
.justfile(
"
alias t := test1
test1:
@echo 'test1'
test2:
@echo 'test2'
",
)
.args(["--no-aliases", "--list"])
.stdout("Available recipes:\n test1\n test2\n")
.run();
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/datetime.rs | tests/datetime.rs | use super::*;
#[test]
fn datetime() {
Test::new()
.justfile(
"
x := datetime('%Y-%m-%d %z')
",
)
.args(["--eval", "x"])
.stdout_regex(r"\d\d\d\d-\d\d-\d\d [+-]\d\d\d\d")
.run();
}
#[test]
fn datetime_utc() {
Test::new()
.justfile(
"
x := datetime_utc('%Y-%... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/shadowing_parameters.rs | tests/shadowing_parameters.rs | use super::*;
#[test]
fn parameter_may_shadow_variable() {
Test::new()
.arg("a")
.arg("bar")
.justfile("FOO := 'hello'\na FOO:\n echo {{FOO}}\n")
.stdout("bar\n")
.stderr("echo bar\n")
.run();
}
#[test]
fn shadowing_parameters_do_not_change_environment() {
Test::new()
.arg("a")
.ar... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/string.rs | tests/string.rs | use super::*;
#[test]
fn raw_string() {
Test::new()
.justfile(
r#"
export EXPORTED_VARIABLE := '\z'
recipe:
printf "$EXPORTED_VARIABLE"
"#,
)
.stdout("\\z")
.stderr("printf \"$EXPORTED_VARIABLE\"\n")
.run();
}
#[test]
fn multiline_raw_string() {
Test::new()
.arg("a")
.justfile... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/parser.rs | tests/parser.rs | use super::*;
#[test]
fn dont_run_duplicate_recipes() {
Test::new()
.justfile(
"
set dotenv-load # foo
bar:
",
)
.run();
}
#[test]
fn invalid_bang_operator() {
Test::new()
.justfile(
"
x := if '' !! '' { '' } else { '' }
",
)
.status(1)
.stderr... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/assert_success.rs | tests/assert_success.rs | #[track_caller]
pub(crate) fn assert_success(output: &std::process::Output) {
if !output.status.success() {
eprintln!("stderr: {}", String::from_utf8_lossy(&output.stderr));
eprintln!("stdout: {}", String::from_utf8_lossy(&output.stdout));
panic!("{}", output.status);
}
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/equals.rs | tests/equals.rs | use super::*;
#[test]
fn export_recipe() {
Test::new()
.justfile(
"
export foo='bar':
echo {{foo}}
",
)
.stdout("bar\n")
.stderr("echo bar\n")
.run();
}
#[test]
fn alias_recipe() {
Test::new()
.justfile(
"
alias foo='bar':
echo {{foo}}
",
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/alias_style.rs | tests/alias_style.rs | use super::*;
#[test]
fn default() {
Test::new()
.justfile(
"
alias f := foo
# comment
foo:
bar:
",
)
.args(["--list"])
.stdout(
"
Available recipes:
bar
foo # comment [alias: f]
",
)
.run();
}
#[test]
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/readme.rs | tests/readme.rs | use super::*;
#[test]
fn readme() {
let mut justfiles = Vec::new();
let mut current = None;
for line in fs::read_to_string("README.md").unwrap().lines() {
if let Some(mut justfile) = current {
if line == "```" {
justfiles.push(justfile);
current = None;
} else {
justfile ... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/format_string.rs | tests/format_string.rs | use super::*;
#[test]
fn empty() {
Test::new()
.justfile(
"
foo := f''
@baz:
echo {{foo}}
",
)
.stdout("\n")
.unindent_stdout(false)
.run();
}
#[test]
fn simple() {
Test::new()
.justfile(
"
foo := f'bar'
@baz:
echo {{f... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/modules.rs | tests/modules.rs | use super::*;
#[test]
fn modules_are_stable() {
Test::new()
.justfile(
"
mod foo
",
)
.write("foo.just", "@bar:\n echo ok")
.args(["foo", "bar"])
.stdout("ok\n")
.run();
}
#[test]
fn default_recipe_in_submodule_must_have_no_arguments() {
Test::new()
.write("foo.just... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/list.rs | tests/list.rs | use super::*;
#[test]
fn modules_unsorted() {
Test::new()
.write("foo.just", "foo:")
.write("bar.just", "bar:")
.justfile(
"
mod foo
mod bar
",
)
.args(["--list", "--unsorted"])
.stdout(
"
Available recipes:
foo ...
bar ...
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/backticks.rs | tests/backticks.rs | use super::*;
#[test]
fn trailing_newlines_are_stripped() {
Test::new()
.shell(false)
.args(["--evaluate", "foos"])
.justfile(
"
set shell := ['python3', '-c']
foos := `print('foo' * 4)`
",
)
.stdout("foofoofoofoo")
.run();
}
| rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/ceiling.rs | tests/ceiling.rs | use super::*;
#[test]
fn justfile_run_search_stops_at_ceiling_dir() {
let tempdir = tempdir();
let ceiling = tempdir.path().join("foo");
fs::create_dir(&ceiling).unwrap();
#[cfg(not(windows))]
let ceiling = ceiling.canonicalize().unwrap();
Test::with_tempdir(tempdir)
.justfile(
"
foo:... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/subsequents.rs | tests/subsequents.rs | use super::*;
#[test]
fn success() {
Test::new()
.justfile(
"
foo: && bar
echo foo
bar:
echo bar
",
)
.stdout(
"
foo
bar
",
)
.stderr(
"
echo foo
echo bar
",
)
.run();
}
#[test]
fn failure() {
Test::new()
.justfile(
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/positional_arguments.rs | tests/positional_arguments.rs | use super::*;
#[test]
fn linewise() {
Test::new()
.arg("foo")
.arg("hello")
.arg("goodbye")
.justfile(
r#"
set positional-arguments
foo bar baz:
echo $0
echo $1
echo $2
echo "$@"
"#,
)
.stdout(
"
foo
hello
goodbye
hello goodbye
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/regexes.rs | tests/regexes.rs | use super::*;
#[test]
fn match_succeeds_evaluates_to_first_branch() {
Test::new()
.justfile(
"
foo := if 'abbbc' =~ 'ab+c' {
'yes'
} else {
'no'
}
default:
echo {{ foo }}
",
)
.stderr("echo yes\n")
.stdout("yes\n")
.run();
}
#[test]
fn m... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/evaluate.rs | tests/evaluate.rs | use super::*;
#[test]
fn evaluate() {
Test::new()
.arg("--evaluate")
.justfile(
r#"
foo := "a\t"
hello := "c"
bar := "b\t"
ab := foo + bar + hello
wut:
touch /this/is/not/a/file
"#,
)
.stdout(
r#"ab := "a b c"
bar := "b "
foo := "a "
hello := "c"
"#,
)
.run();
}
#[test]... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/which_function.rs | tests/which_function.rs | use super::*;
const HELLO_SCRIPT: &str = "#!/usr/bin/env bash
echo hello
";
#[test]
fn finds_executable() {
let tmp = tempdir();
let path = PathBuf::from(tmp.path());
Test::with_tempdir(tmp)
.justfile("p := which('hello.exe')")
.args(["--evaluate", "p"])
.write("hello.exe", HELLO_SCRIPT)
.make_... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/error_messages.rs | tests/error_messages.rs | use super::*;
#[test]
fn invalid_alias_attribute() {
Test::new()
.justfile("[private]\n[linux]\nalias t := test\n\ntest:\n")
.stderr(
"
error: Alias `t` has invalid attribute `linux`
——▶ justfile:3:7
│
3 │ alias t := test
│ ^
",
)
.status(EXIT_FAILURE)
.run(... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/functions.rs | tests/functions.rs | use super::*;
#[test]
fn test_os_arch_functions_in_interpolation() {
Test::new()
.justfile(
r"
foo:
echo {{arch()}} {{os()}} {{os_family()}} {{num_cpus()}}
",
)
.stdout(
format!(
"{} {} {} {}\n",
target::arch(),
target::os(),
target::family(),
num_cpu... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/no_dependencies.rs | tests/no_dependencies.rs | use super::*;
#[test]
fn skip_normal_dependency() {
Test::new()
.justfile(
"
a:
@echo 'a'
b: a
@echo 'b'
",
)
.args(["--no-deps", "b"])
.stdout("b\n")
.run();
}
#[test]
fn skip_prior_dependency() {
Test::new()
.justfile(
"
a:
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/shell.rs | tests/shell.rs | use super::*;
const JUSTFILE: &str = "
expression := `EXPRESSION`
recipe default=`DEFAULT`:
{{expression}}
{{default}}
RECIPE
";
/// Test that --shell correctly sets the shell
#[test]
#[cfg_attr(windows, ignore)]
fn flag() {
let tmp = temptree! {
justfile: JUSTFILE,
shell: "#!/usr/bin/env bash\necho ... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/invocation_directory.rs | tests/invocation_directory.rs | use super::*;
#[cfg(unix)]
fn convert_native_path(path: &Path) -> String {
fs::canonicalize(path)
.expect("canonicalize failed")
.to_str()
.map(str::to_string)
.expect("unicode decode failed")
}
#[cfg(windows)]
fn convert_native_path(path: &Path) -> String {
// Translate path from windows style to... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/default.rs | tests/default.rs | use super::*;
#[test]
fn default_attribute_overrides_first_recipe() {
Test::new()
.justfile(
"
foo:
@echo FOO
[default]
bar:
@echo BAR
",
)
.stdout("BAR\n")
.run();
}
#[test]
fn default_attribute_may_only_appear_once_per_justfile() {
Test::n... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/search.rs | tests/search.rs | use super::*;
fn search_test<P: AsRef<Path>>(path: P, args: &[&str]) {
let binary = executable_path("just");
let output = Command::new(binary)
.current_dir(path)
.args(args)
.output()
.expect("just invocation failed");
assert_eq!(output.status.code().unwrap(), 0);
let stdout = str::from_utf8... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/json.rs | tests/json.rs | use super::*;
#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
struct Alias<'a> {
attributes: Vec<&'a str>,
name: &'a str,
target: &'a str,
}
#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
struct Assignment<'a> {
export: boo... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/os_attributes.rs | tests/os_attributes.rs | use super::*;
#[test]
fn os_family() {
Test::new()
.justfile(
"
[unix]
foo:
echo bar
[windows]
foo:
echo baz
",
)
.stdout(if cfg!(unix) {
"bar\n"
} else if cfg!(windows) {
"baz\n"
} else {
panic!("unexpected os family")
})
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/no_cd.rs | tests/no_cd.rs | use super::*;
#[test]
fn linewise() {
Test::new()
.justfile(
"
[no-cd]
foo:
cat bar
",
)
.current_dir("foo")
.tree(tree! {
foo: {
bar: "hello",
}
})
.stderr("cat bar\n")
.stdout("hello")
.run();
}
#[test]
fn shebang() {
Test::new()
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/explain.rs | tests/explain.rs | use super::*;
#[test]
fn explain_recipe() {
Test::new()
.justfile(
"
# List some fruits
fruits:
echo 'apple peach dragonfruit'
",
)
.args(["--explain", "fruits"])
.stdout("apple peach dragonfruit\n")
.stderr(
"
#### List some fruits
echo 'apple peac... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
casey/just | https://github.com/casey/just/blob/5732ee083a58c534804d184acbdede11d1bbaac5/tests/windows_shell.rs | tests/windows_shell.rs | use super::*;
#[test]
fn windows_shell_setting() {
Test::new()
.justfile(
r#"
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
set shell := ["asdfasdfasdfasdf"]
foo:
Write-Output bar
"#,
)
.shell(false)
.stdout("bar\r\n")
.stderr("Write-Output bar\n")
... | rust | CC0-1.0 | 5732ee083a58c534804d184acbdede11d1bbaac5 | 2026-01-04T15:34:07.853244Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.