Do use super::*;
instead of use crate::common::*;
(#1239)
This commit is contained in:
parent
180672b0e1
commit
01fae9b1e4
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// An alias, e.g. `name := target`
|
/// An alias, e.g. `name := target`
|
||||||
#[derive(Debug, PartialEq, Clone, Serialize)]
|
#[derive(Debug, PartialEq, Clone, Serialize)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use CompileErrorKind::*;
|
use CompileErrorKind::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// An assignment, e.g `foo := bar`
|
/// An assignment, e.g `foo := bar`
|
||||||
pub(crate) type Assignment<'src> = Binding<'src, Expression<'src>>;
|
pub(crate) type Assignment<'src> = Binding<'src, Expression<'src>>;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use CompileErrorKind::*;
|
use CompileErrorKind::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// The top-level type produced by the parser. Not all successful parses result
|
/// The top-level type produced by the parser. Not all successful parses result
|
||||||
/// in valid justfiles, so additional consistency checks and name resolution
|
/// in valid justfiles, so additional consistency checks and name resolution
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A binding of `name` to `value`
|
/// A binding of `name` to `value`
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix};
|
use ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix};
|
||||||
use atty::Stream;
|
use atty::Stream;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) trait ColorDisplay {
|
pub(crate) trait ColorDisplay {
|
||||||
fn color_display<'a>(&'a self, color: Color) -> Wrapper<'a>
|
fn color_display<'a>(&'a self, color: Color) -> Wrapper<'a>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) trait CommandExt {
|
pub(crate) trait CommandExt {
|
||||||
fn export(&mut self, settings: &Settings, dotenv: &BTreeMap<String, String>, scope: &Scope);
|
fn export(&mut self, settings: &Settings, dotenv: &BTreeMap<String, String>, scope: &Scope);
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
// stdlib
|
|
||||||
pub(crate) use std::{
|
|
||||||
cmp,
|
|
||||||
collections::{BTreeMap, BTreeSet},
|
|
||||||
env,
|
|
||||||
ffi::{OsStr, OsString},
|
|
||||||
fmt::{self, Debug, Display, Formatter},
|
|
||||||
fs,
|
|
||||||
io::{self, Cursor, Write},
|
|
||||||
iter::{self, FromIterator},
|
|
||||||
mem,
|
|
||||||
ops::{Index, Range, RangeInclusive},
|
|
||||||
path::{self, Path, PathBuf},
|
|
||||||
process::{self, Command, ExitStatus, Stdio},
|
|
||||||
rc::Rc,
|
|
||||||
str::{self, Chars},
|
|
||||||
sync::{Mutex, MutexGuard},
|
|
||||||
usize, vec,
|
|
||||||
};
|
|
||||||
|
|
||||||
// dependencies
|
|
||||||
pub(crate) use ::{
|
|
||||||
camino::Utf8Path,
|
|
||||||
derivative::Derivative,
|
|
||||||
edit_distance::edit_distance,
|
|
||||||
lexiclean::Lexiclean,
|
|
||||||
libc::EXIT_FAILURE,
|
|
||||||
log::{info, warn},
|
|
||||||
regex::Regex,
|
|
||||||
serde::{
|
|
||||||
ser::{SerializeMap, SerializeSeq},
|
|
||||||
Serialize, Serializer,
|
|
||||||
},
|
|
||||||
snafu::{ResultExt, Snafu},
|
|
||||||
strum::{Display, EnumString, IntoStaticStr},
|
|
||||||
typed_arena::Arena,
|
|
||||||
unicode_width::{UnicodeWidthChar, UnicodeWidthStr},
|
|
||||||
};
|
|
||||||
|
|
||||||
// modules
|
|
||||||
pub(crate) use crate::{completions, config, config_error, keyed};
|
|
||||||
|
|
||||||
// functions
|
|
||||||
pub(crate) use crate::{load_dotenv::load_dotenv, output::output, unindent::unindent};
|
|
||||||
|
|
||||||
// traits
|
|
||||||
pub(crate) use crate::{
|
|
||||||
color_display::ColorDisplay, command_ext::CommandExt, keyed::Keyed, ordinal::Ordinal,
|
|
||||||
platform_interface::PlatformInterface, range_ext::RangeExt,
|
|
||||||
};
|
|
||||||
|
|
||||||
// structs and enums
|
|
||||||
pub(crate) use crate::{
|
|
||||||
alias::Alias, analyzer::Analyzer, assignment::Assignment,
|
|
||||||
assignment_resolver::AssignmentResolver, ast::Ast, binding::Binding, color::Color,
|
|
||||||
compile_error::CompileError, compile_error_kind::CompileErrorKind,
|
|
||||||
conditional_operator::ConditionalOperator, config::Config, config_error::ConfigError,
|
|
||||||
count::Count, delimiter::Delimiter, dependency::Dependency, dump_format::DumpFormat,
|
|
||||||
enclosure::Enclosure, error::Error, evaluator::Evaluator, expression::Expression,
|
|
||||||
fragment::Fragment, function::Function, function_context::FunctionContext,
|
|
||||||
interrupt_guard::InterruptGuard, interrupt_handler::InterruptHandler, item::Item,
|
|
||||||
justfile::Justfile, keyword::Keyword, lexer::Lexer, line::Line, list::List, loader::Loader,
|
|
||||||
name::Name, output_error::OutputError, parameter::Parameter, parameter_kind::ParameterKind,
|
|
||||||
parser::Parser, platform::Platform, position::Position, positional::Positional, recipe::Recipe,
|
|
||||||
recipe_context::RecipeContext, recipe_resolver::RecipeResolver, scope::Scope, search::Search,
|
|
||||||
search_config::SearchConfig, search_error::SearchError, set::Set, setting::Setting,
|
|
||||||
settings::Settings, shebang::Shebang, shell::Shell, show_whitespace::ShowWhitespace,
|
|
||||||
string_kind::StringKind, string_literal::StringLiteral, subcommand::Subcommand,
|
|
||||||
suggestion::Suggestion, table::Table, thunk::Thunk, token::Token, token_kind::TokenKind,
|
|
||||||
unresolved_dependency::UnresolvedDependency, unresolved_recipe::UnresolvedRecipe,
|
|
||||||
use_color::UseColor, variables::Variables, verbosity::Verbosity, warning::Warning,
|
|
||||||
};
|
|
||||||
|
|
||||||
// type aliases
|
|
||||||
pub(crate) type CompileResult<'a, T> = Result<T, CompileError<'a>>;
|
|
||||||
pub(crate) type ConfigResult<T> = Result<T, ConfigError>;
|
|
||||||
pub(crate) type RunResult<'a, T> = Result<T, Error<'a>>;
|
|
||||||
pub(crate) type SearchResult<T> = Result<T, SearchError>;
|
|
||||||
|
|
||||||
// modules used in tests
|
|
||||||
#[cfg(test)]
|
|
||||||
pub(crate) use crate::testing;
|
|
||||||
|
|
||||||
// structs and enums used in tests
|
|
||||||
#[cfg(test)]
|
|
||||||
pub(crate) use crate::{node::Node, tree::Tree};
|
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub(crate) struct CompileError<'src> {
|
pub(crate) struct CompileError<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub(crate) enum CompileErrorKind<'src> {
|
pub(crate) enum CompileErrorKind<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct Compiler;
|
pub(crate) struct Compiler;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A conditional expression operator.
|
/// A conditional expression operator.
|
||||||
#[derive(PartialEq, Debug, Copy, Clone)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, ArgSettings};
|
use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, ArgSettings};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Snafu)]
|
#[derive(Debug, Snafu)]
|
||||||
#[snafu(visibility(pub(crate)), context(suffix(Context)))]
|
#[snafu(visibility(pub(crate)), context(suffix(Context)))]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub struct Count<T: Display>(pub T, pub usize);
|
pub struct Count<T: Display>(pub T, pub usize);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Serialize)]
|
#[derive(PartialEq, Debug, Serialize)]
|
||||||
pub(crate) struct Dependency<'src> {
|
pub(crate) struct Dependency<'src> {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// `Self` cannot be used where type takes generic arguments
|
// `Self` cannot be used where type takes generic arguments
|
||||||
#![allow(clippy::use_self)]
|
#![allow(clippy::use_self)]
|
||||||
|
|
||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub struct Enclosure<T: Display> {
|
pub struct Enclosure<T: Display> {
|
||||||
enclosure: &'static str,
|
enclosure: &'static str,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) enum Error<'src> {
|
pub(crate) enum Error<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct Evaluator<'src: 'run, 'run> {
|
pub(crate) struct Evaluator<'src: 'run, 'run> {
|
||||||
assignments: Option<&'run Table<'src, Assignment<'src>>>,
|
assignments: Option<&'run Table<'src, Assignment<'src>>>,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// An expression. Note that the Just language grammar has both an `expression`
|
/// An expression. Note that the Just language grammar has both an `expression`
|
||||||
/// production of additions (`a + b`) and values, and a `value` production of
|
/// production of additions (`a + b`) and values, and a `value` production of
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A line fragment consisting either of…
|
/// A line fragment consisting either of…
|
||||||
#[derive(PartialEq, Debug, Clone)]
|
#[derive(PartialEq, Debug, Clone)]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#![allow(unknown_lints)]
|
#![allow(unknown_lints)]
|
||||||
#![allow(clippy::unnecessary_wraps)]
|
#![allow(clippy::unnecessary_wraps)]
|
||||||
|
|
||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use Function::*;
|
use Function::*;
|
||||||
pub(crate) enum Function {
|
pub(crate) enum Function {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct FunctionContext<'run> {
|
pub(crate) struct FunctionContext<'run> {
|
||||||
pub(crate) dotenv: &'run BTreeMap<String, String>,
|
pub(crate) dotenv: &'run BTreeMap<String, String>,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) fn compile(text: &str) {
|
pub(crate) fn compile(text: &str) {
|
||||||
if let Err(error) = Parser::parse(text) {
|
if let Err(error) = Parser::parse(text) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct InterruptGuard;
|
pub(crate) struct InterruptGuard;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct InterruptHandler {
|
pub(crate) struct InterruptHandler {
|
||||||
blocks: u32,
|
blocks: u32,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A single top-level item
|
/// A single top-level item
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) trait Keyed<'key> {
|
pub(crate) trait Keyed<'key> {
|
||||||
fn key(&self) -> &'key str;
|
fn key(&self) -> &'key str;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq, IntoStaticStr, Display, Copy, Clone, EnumString)]
|
#[derive(Debug, Eq, PartialEq, IntoStaticStr, Display, Copy, Clone, EnumString)]
|
||||||
#[strum(serialize_all = "kebab_case")]
|
#[strum(serialize_all = "kebab_case")]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use CompileErrorKind::*;
|
use CompileErrorKind::*;
|
||||||
use TokenKind::*;
|
use TokenKind::*;
|
||||||
|
70
src/lib.rs
70
src/lib.rs
@ -14,12 +14,81 @@
|
|||||||
clippy::wildcard_imports
|
clippy::wildcard_imports
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
pub(crate) use {
|
||||||
|
crate::{
|
||||||
|
alias::Alias, analyzer::Analyzer, assignment::Assignment,
|
||||||
|
assignment_resolver::AssignmentResolver, ast::Ast, binding::Binding, color::Color,
|
||||||
|
color_display::ColorDisplay, command_ext::CommandExt, compile_error::CompileError,
|
||||||
|
compile_error_kind::CompileErrorKind, conditional_operator::ConditionalOperator,
|
||||||
|
config::Config, config_error::ConfigError, count::Count, delimiter::Delimiter,
|
||||||
|
dependency::Dependency, dump_format::DumpFormat, enclosure::Enclosure, error::Error,
|
||||||
|
evaluator::Evaluator, expression::Expression, fragment::Fragment, function::Function,
|
||||||
|
function_context::FunctionContext, interrupt_guard::InterruptGuard,
|
||||||
|
interrupt_handler::InterruptHandler, item::Item, justfile::Justfile, keyed::Keyed,
|
||||||
|
keyword::Keyword, lexer::Lexer, line::Line, list::List, load_dotenv::load_dotenv,
|
||||||
|
loader::Loader, name::Name, ordinal::Ordinal, output::output, output_error::OutputError,
|
||||||
|
parameter::Parameter, parameter_kind::ParameterKind, parser::Parser, platform::Platform,
|
||||||
|
platform_interface::PlatformInterface, position::Position, positional::Positional,
|
||||||
|
range_ext::RangeExt, recipe::Recipe, recipe_context::RecipeContext,
|
||||||
|
recipe_resolver::RecipeResolver, scope::Scope, search::Search, search_config::SearchConfig,
|
||||||
|
search_error::SearchError, set::Set, setting::Setting, settings::Settings, shebang::Shebang,
|
||||||
|
shell::Shell, show_whitespace::ShowWhitespace, string_kind::StringKind,
|
||||||
|
string_literal::StringLiteral, subcommand::Subcommand, suggestion::Suggestion, table::Table,
|
||||||
|
thunk::Thunk, token::Token, token_kind::TokenKind, unresolved_dependency::UnresolvedDependency,
|
||||||
|
unresolved_recipe::UnresolvedRecipe, use_color::UseColor, variables::Variables,
|
||||||
|
verbosity::Verbosity, warning::Warning,
|
||||||
|
},
|
||||||
|
std::{
|
||||||
|
cmp,
|
||||||
|
collections::{BTreeMap, BTreeSet},
|
||||||
|
env,
|
||||||
|
ffi::{OsStr, OsString},
|
||||||
|
fmt::{self, Debug, Display, Formatter},
|
||||||
|
fs,
|
||||||
|
io::{self, Cursor, Write},
|
||||||
|
iter::{self, FromIterator},
|
||||||
|
mem,
|
||||||
|
ops::{Index, Range, RangeInclusive},
|
||||||
|
path::{self, Path, PathBuf},
|
||||||
|
process::{self, Command, ExitStatus, Stdio},
|
||||||
|
rc::Rc,
|
||||||
|
str::{self, Chars},
|
||||||
|
sync::{Mutex, MutexGuard},
|
||||||
|
usize, vec,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
camino::Utf8Path,
|
||||||
|
derivative::Derivative,
|
||||||
|
edit_distance::edit_distance,
|
||||||
|
lexiclean::Lexiclean,
|
||||||
|
libc::EXIT_FAILURE,
|
||||||
|
log::{info, warn},
|
||||||
|
regex::Regex,
|
||||||
|
serde::{
|
||||||
|
ser::{SerializeMap, SerializeSeq},
|
||||||
|
Serialize, Serializer,
|
||||||
|
},
|
||||||
|
snafu::{ResultExt, Snafu},
|
||||||
|
strum::{Display, EnumString, IntoStaticStr},
|
||||||
|
typed_arena::Arena,
|
||||||
|
unicode_width::{UnicodeWidthChar, UnicodeWidthStr},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
pub(crate) use crate::{node::Node, tree::Tree};
|
||||||
|
|
||||||
pub use crate::run::run;
|
pub use crate::run::run;
|
||||||
|
|
||||||
// Used in integration tests.
|
// Used in integration tests.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use unindent::unindent;
|
pub use unindent::unindent;
|
||||||
|
|
||||||
|
pub(crate) type CompileResult<'a, T> = Result<T, CompileError<'a>>;
|
||||||
|
pub(crate) type ConfigResult<T> = Result<T, ConfigError>;
|
||||||
|
pub(crate) type RunResult<'a, T> = Result<T, Error<'a>>;
|
||||||
|
pub(crate) type SearchResult<T> = Result<T, SearchError>;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
@ -52,7 +121,6 @@ mod binding;
|
|||||||
mod color;
|
mod color;
|
||||||
mod color_display;
|
mod color_display;
|
||||||
mod command_ext;
|
mod command_ext;
|
||||||
mod common;
|
|
||||||
mod compile_error;
|
mod compile_error;
|
||||||
mod compile_error_kind;
|
mod compile_error_kind;
|
||||||
mod compiler;
|
mod compiler;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A single line in a recipe body, consisting of any number of `Fragment`s.
|
/// A single line in a recipe body, consisting of any number of `Fragment`s.
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// `Self` cannot be used where type takes generic arguments
|
// `Self` cannot be used where type takes generic arguments
|
||||||
#![allow(clippy::use_self)]
|
#![allow(clippy::use_self)]
|
||||||
|
|
||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub struct List<T: Display, I: Iterator<Item = T> + Clone> {
|
pub struct List<T: Display, I: Iterator<Item = T> + Clone> {
|
||||||
conjunction: &'static str,
|
conjunction: &'static str,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
const DEFAULT_DOTENV_FILENAME: &str = ".env";
|
const DEFAULT_DOTENV_FILENAME: &str = ".env";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct Loader {
|
pub(crate) struct Loader {
|
||||||
arena: Arena<String>,
|
arena: Arena<String>,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A name. This is effectively just a `Token` of kind `Identifier`, but we give
|
/// A name. This is effectively just a `Token` of kind `Identifier`, but we give
|
||||||
/// it its own type for clarity.
|
/// it its own type for clarity.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// Methods common to all AST nodes. Currently only used in parser unit tests.
|
/// Methods common to all AST nodes. Currently only used in parser unit tests.
|
||||||
pub(crate) trait Node<'src> {
|
pub(crate) trait Node<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// Run a command and return the data it wrote to stdout as a string
|
/// Run a command and return the data it wrote to stdout as a string
|
||||||
pub(crate) fn output(mut command: Command) -> Result<String, OutputError> {
|
pub(crate) fn output(mut command: Command) -> Result<String, OutputError> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) enum OutputError {
|
pub(crate) enum OutputError {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A single function parameter
|
/// A single function parameter
|
||||||
#[derive(PartialEq, Debug, Clone, Serialize)]
|
#[derive(PartialEq, Debug, Clone, Serialize)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// Parameters can either be…
|
/// Parameters can either be…
|
||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use TokenKind::*;
|
use TokenKind::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct Platform;
|
pub(crate) struct Platform;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) trait PlatformInterface {
|
pub(crate) trait PlatformInterface {
|
||||||
/// Construct a command equivalent to running the script at `path` with the
|
/// Construct a command equivalent to running the script at `path` with the
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// A struct containing the parsed representation of positional command-line
|
/// A struct containing the parsed representation of positional command-line
|
||||||
/// arguments, i.e. arguments that are not flags, options, or the subcommand.
|
/// arguments, i.e. arguments that are not flags, options, or the subcommand.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) trait RangeExt<T> {
|
pub(crate) trait RangeExt<T> {
|
||||||
fn range_contains(&self, i: &T) -> bool;
|
fn range_contains(&self, i: &T) -> bool;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use std::process::{ExitStatus, Stdio};
|
use std::process::{ExitStatus, Stdio};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct RecipeContext<'src: 'run, 'run> {
|
pub(crate) struct RecipeContext<'src: 'run, 'run> {
|
||||||
pub(crate) config: &'run Config,
|
pub(crate) config: &'run Config,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use CompileErrorKind::*;
|
use CompileErrorKind::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub fn run() -> Result<(), i32> {
|
pub fn run() -> Result<(), i32> {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) struct Scope<'src: 'run, 'run> {
|
pub(crate) struct Scope<'src: 'run, 'run> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use std::path::Component;
|
use std::path::Component;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// Controls how `just` will search for the justfile.
|
/// Controls how `just` will search for the justfile.
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Snafu)]
|
#[derive(Debug, Snafu)]
|
||||||
#[snafu(visibility(pub(crate)))]
|
#[snafu(visibility(pub(crate)))]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub(crate) struct Set<'src> {
|
pub(crate) struct Set<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub(crate) enum Setting<'src> {
|
pub(crate) enum Setting<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) const DEFAULT_SHELL: &str = "sh";
|
pub(crate) const DEFAULT_SHELL: &str = "sh";
|
||||||
pub(crate) const DEFAULT_SHELL_ARGS: &[&str] = &["-cu"];
|
pub(crate) const DEFAULT_SHELL_ARGS: &[&str] = &["-cu"];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
pub(crate) struct Shell<'src> {
|
pub(crate) struct Shell<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
/// String wrapper that uses nonblank characters to display spaces and tabs
|
/// String wrapper that uses nonblank characters to display spaces and tabs
|
||||||
pub struct ShowWhitespace<'str>(pub &'str str);
|
pub struct ShowWhitespace<'str>(pub &'str str);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Copy, Ord, PartialOrd, Eq)]
|
#[derive(Debug, PartialEq, Clone, Copy, Ord, PartialOrd, Eq)]
|
||||||
pub(crate) struct StringKind {
|
pub(crate) struct StringKind {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Clone)]
|
#[derive(PartialEq, Debug, Clone)]
|
||||||
pub(crate) struct StringLiteral<'src> {
|
pub(crate) struct StringLiteral<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
const INIT_JUSTFILE: &str = "default:\n echo 'Hello, world!'\n";
|
const INIT_JUSTFILE: &str = "default:\n echo 'Hello, world!'\n";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||||
pub(crate) struct Suggestion<'src> {
|
pub(crate) struct Suggestion<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use std::collections::btree_map;
|
use std::collections::btree_map;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use crate::compiler::Compiler;
|
use crate::compiler::Compiler;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Derivative)]
|
#[derive(Derivative)]
|
||||||
#[derivative(Debug, Clone, PartialEq = "feature_allow_slow_enum")]
|
#[derivative(Debug, Clone, PartialEq = "feature_allow_slow_enum")]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Clone, Copy)]
|
||||||
pub(crate) struct Token<'src> {
|
pub(crate) struct Token<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Copy, Ord, PartialOrd, Eq)]
|
#[derive(Debug, PartialEq, Clone, Copy, Ord, PartialOrd, Eq)]
|
||||||
pub(crate) enum TokenKind {
|
pub(crate) enum TokenKind {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
use std::{borrow::Cow, mem};
|
use std::{borrow::Cow, mem};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Clone)]
|
#[derive(PartialEq, Debug, Clone)]
|
||||||
pub(crate) struct UnresolvedDependency<'src> {
|
pub(crate) struct UnresolvedDependency<'src> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) type UnresolvedRecipe<'src> = Recipe<'src, UnresolvedDependency<'src>>;
|
pub(crate) type UnresolvedRecipe<'src> = Recipe<'src, UnresolvedDependency<'src>>;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) struct Variables<'expression, 'src> {
|
pub(crate) struct Variables<'expression, 'src> {
|
||||||
stack: Vec<&'expression Expression<'src>>,
|
stack: Vec<&'expression Expression<'src>>,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub(crate) enum Warning {}
|
pub(crate) enum Warning {}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn allow_duplicate_recipes() {
|
fn allow_duplicate_recipes() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) fn assert_stdout(output: &Output, stdout: &str) {
|
pub(crate) fn assert_stdout(output: &Output, stdout: &str) {
|
||||||
assert_success(output);
|
assert_success(output);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
pub(crate) fn assert_success(output: &Output) {
|
pub(crate) fn assert_success(output: &Output) {
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ignore_leading_byte_order_mark() {
|
fn ignore_leading_byte_order_mark() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn print_changelog() {
|
fn print_changelog() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: env,
|
name: env,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: long,
|
name: long,
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
pub(crate) use std::{
|
|
||||||
collections::BTreeMap,
|
|
||||||
env::{self, consts::EXE_SUFFIX},
|
|
||||||
error::Error,
|
|
||||||
fmt::Debug,
|
|
||||||
fs,
|
|
||||||
io::Write,
|
|
||||||
iter,
|
|
||||||
path::{Path, PathBuf, MAIN_SEPARATOR},
|
|
||||||
process::{Command, Output, Stdio},
|
|
||||||
str,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub(crate) use ::{
|
|
||||||
cradle::input::Input,
|
|
||||||
executable_path::executable_path,
|
|
||||||
just::unindent,
|
|
||||||
libc::{EXIT_FAILURE, EXIT_SUCCESS},
|
|
||||||
pretty_assertions::Comparison,
|
|
||||||
regex::Regex,
|
|
||||||
serde_json::{json, Value},
|
|
||||||
tempfile::TempDir,
|
|
||||||
temptree::{temptree, tree, Tree},
|
|
||||||
which::which,
|
|
||||||
yaml_rust::YamlLoader,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub(crate) use crate::{
|
|
||||||
assert_stdout::assert_stdout, assert_success::assert_success, tempdir::tempdir, test::Test,
|
|
||||||
};
|
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn output() {
|
fn output() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: then_branch_unevaluated,
|
name: then_branch_unevaluated,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: mismatched_delimiter,
|
name: mismatched_delimiter,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dotenv() {
|
fn dotenv() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
const JUSTFILE: &str = "Yooooooo, hopefully this never becomes valid syntax.";
|
const JUSTFILE: &str = "Yooooooo, hopefully this never becomes valid syntax.";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn export_recipe() {
|
fn export_recipe() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: expected_keyword,
|
name: expected_keyword,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: evaluate,
|
name: evaluate,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn examples() {
|
fn examples() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn runs_recipe_in_parent_if_not_found_in_current() {
|
fn runs_recipe_in_parent_if_not_found_in_current() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: unstable_not_passed,
|
name: unstable_not_passed,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
test! {
|
test! {
|
||||||
name: test_os_arch_functions_in_interpolation,
|
name: test_os_arch_functions_in_interpolation,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
const EXPECTED: &str = "default:\n echo 'Hello, world!'\n";
|
const EXPECTED: &str = "default:\n echo 'Hello, world!'\n";
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#[cfg(unix)]
|
use super::*;
|
||||||
mod unix {
|
|
||||||
use crate::common::*;
|
|
||||||
|
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
@ -87,4 +85,3 @@ mod unix {
|
|||||||
fn interrupt_command() {
|
fn interrupt_command() {
|
||||||
interrupt_test(&["--command", "sleep", "1"], "");
|
interrupt_test(&["--command", "sleep", "1"], "");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn convert_native_path(path: &Path) -> String {
|
fn convert_native_path(path: &Path) -> String {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::common::*;
|
use super::*;
|
||||||
|
|
||||||
fn test(justfile: &str, value: Value) {
|
fn test(justfile: &str, value: Value) {
|
||||||
Test::new()
|
Test::new()
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user