1
1
mirror of https://github.com/casey/just.git synced 2024-09-11 05:55:31 +03:00

Merge imports (#1462)

This commit is contained in:
Casey Rodarmor 2022-12-27 20:16:18 -08:00 committed by GitHub
parent e7721d0a84
commit 157862d398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 47 additions and 62 deletions

View File

@ -1,5 +1,4 @@
use regex::Regex;
use structopt::StructOpt;
use {regex::Regex, structopt::StructOpt};
#[derive(StructOpt)]
struct Arguments {

View File

@ -1,5 +1,7 @@
use executable_path::executable_path;
use std::{process::Command, str};
use {
executable_path::executable_path,
std::{process::Command, str},
};
fn stdout(reference: &str) -> String {
let output = Command::new(executable_path("ref-type"))

View File

@ -1,6 +1,4 @@
use super::*;
use CompileErrorKind::*;
use {super::*, CompileErrorKind::*};
const VALID_ALIAS_ATTRIBUTES: [Attribute; 1] = [Attribute::Private];

View File

@ -1,6 +1,4 @@
use super::*;
use CompileErrorKind::*;
use {super::*, CompileErrorKind::*};
pub(crate) struct AssignmentResolver<'src: 'run, 'run> {
assignments: &'run Table<'src, Assignment<'src>>,

View File

@ -1,7 +1,8 @@
use super::*;
use ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix};
use atty::Stream;
use {
super::*,
ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix},
atty::Stream,
};
#[derive(Copy, Clone, Debug, PartialEq)]
pub(crate) struct Color {

View File

@ -1,6 +1,7 @@
use super::*;
use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, ArgSettings};
use {
super::*,
clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, ArgSettings},
};
// These three strings should be kept in sync:
pub(crate) const CHOOSER_DEFAULT: &str = "fzf";

View File

@ -1,15 +1,15 @@
#![allow(unknown_lints)]
#![allow(clippy::unnecessary_wraps)]
use super::*;
use heck::{
ToKebabCase, ToLowerCamelCase, ToShoutyKebabCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCase,
ToUpperCamelCase,
use {
super::*,
heck::{
ToKebabCase, ToLowerCamelCase, ToShoutyKebabCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCase,
ToUpperCamelCase,
},
Function::*,
};
use Function::*;
pub(crate) enum Function {
Nullary(fn(&FunctionContext) -> Result<String, String>),
Unary(fn(&FunctionContext, &str) -> Result<String, String>),

View File

@ -1,6 +1,4 @@
use super::*;
use serde::Serialize;
use {super::*, serde::Serialize};
#[derive(Debug, PartialEq, Serialize)]
pub(crate) struct Justfile<'src> {

View File

@ -1,7 +1,4 @@
use super::*;
use CompileErrorKind::*;
use TokenKind::*;
use {super::*, CompileErrorKind::*, TokenKind::*};
/// Just language lexer
///

View File

@ -1,6 +1,4 @@
use super::*;
use TokenKind::*;
use {super::*, TokenKind::*};
/// Just language parser
///

View File

@ -1,6 +1,7 @@
use super::*;
use std::process::{ExitStatus, Stdio};
use {
super::*,
std::process::{ExitStatus, Stdio},
};
/// Return a `Error::Signal` if the process was terminated by a signal,
/// otherwise return an `Error::UnknownFailure`

View File

@ -1,6 +1,4 @@
use super::*;
use CompileErrorKind::*;
use {super::*, CompileErrorKind::*};
pub(crate) struct RecipeResolver<'src: 'run, 'run> {
unresolved_recipes: Table<'src, UnresolvedRecipe<'src>>,

View File

@ -1,6 +1,4 @@
use super::*;
use std::path::Component;
use {super::*, std::path::Component};
const DEFAULT_JUSTFILE_NAME: &str = JUSTFILE_NAMES[0];
const JUSTFILE_NAMES: &[&str] = &["justfile", ".justfile"];

View File

@ -12,9 +12,10 @@
//! that changes to just do not inadvertently break or change the interpretation
//! of existing justfiles.
use std::{collections::BTreeMap, fs, io, path::Path};
use crate::compiler::Compiler;
use {
crate::compiler::Compiler,
std::{collections::BTreeMap, fs, io, path::Path},
};
mod full {
pub(crate) use crate::{

View File

@ -1,6 +1,4 @@
use super::*;
use std::collections::btree_map;
use {super::*, std::collections::btree_map};
#[derive(Debug, PartialEq, Serialize)]
#[serde(transparent)]

View File

@ -1,7 +1,4 @@
use super::*;
use crate::compiler::Compiler;
use pretty_assertions::assert_eq;
use {super::*, crate::compiler::Compiler, pretty_assertions::assert_eq};
pub(crate) fn compile(text: &str) -> Justfile {
match Compiler::compile(text) {

View File

@ -1,6 +1,7 @@
use super::*;
use std::{borrow::Cow, mem};
use {
super::*,
std::{borrow::Cow, mem},
};
/// Construct a `Tree` from a symbolic expression literal. This macro, and the
/// Tree type, are only used in the Parser unit tests, providing a concise

View File

@ -1,6 +1,7 @@
use super::*;
use std::time::{Duration, Instant};
use {
super::*,
std::time::{Duration, Instant},
};
fn kill(process_id: u32) {
unsafe {

View File

@ -1,6 +1,4 @@
use super::*;
use pretty_assertions::assert_eq;
use {super::*, pretty_assertions::assert_eq};
macro_rules! test {
{