mirror of
https://github.com/nix-community/nix-init.git
synced 2024-07-14 11:10:25 +03:00
update rustfmt.toml
This commit is contained in:
parent
826246e01d
commit
506116dd77
8
build.rs
8
build.rs
@ -1,13 +1,13 @@
|
|||||||
use clap::{CommandFactory, ValueEnum};
|
|
||||||
use clap_complete::{generate_to, Shell};
|
|
||||||
use clap_mangen::Man;
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
env,
|
env,
|
||||||
fs::{create_dir_all, File},
|
fs::{create_dir_all, File},
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use clap::{CommandFactory, ValueEnum};
|
||||||
|
use clap_complete::{generate_to, Shell};
|
||||||
|
use clap_mangen::Man;
|
||||||
|
|
||||||
include!("src/cli.rs");
|
include!("src/cli.rs");
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use askalono::Store;
|
|
||||||
|
|
||||||
use std::{env::args_os, fs::File};
|
use std::{env::args_os, fs::File};
|
||||||
|
|
||||||
|
use askalono::Store;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut args = args_os();
|
let mut args = args_os();
|
||||||
args.next().unwrap();
|
args.next().unwrap();
|
||||||
|
@ -2,11 +2,11 @@ unstable_features = true
|
|||||||
|
|
||||||
condense_wildcard_suffixes = true
|
condense_wildcard_suffixes = true
|
||||||
format_code_in_doc_comments = true
|
format_code_in_doc_comments = true
|
||||||
|
group_imports = "StdExternalCrate"
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Crate"
|
||||||
newline_style = "Unix"
|
newline_style = "Unix"
|
||||||
normalize_comments = true
|
normalize_comments = true
|
||||||
normalize_doc_attributes = true
|
normalize_doc_attributes = true
|
||||||
overflow_delimited_expr = false
|
|
||||||
reorder_impl_items = true
|
reorder_impl_items = true
|
||||||
spaces_around_ranges = true
|
spaces_around_ranges = true
|
||||||
use_field_init_shorthand = true
|
use_field_init_shorthand = true
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use parse_display::Display;
|
|
||||||
|
|
||||||
use std::fmt::{self, Display, Formatter};
|
use std::fmt::{self, Display, Formatter};
|
||||||
|
|
||||||
|
use parse_display::Display;
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub enum BuildType {
|
pub enum BuildType {
|
||||||
BuildGoModule,
|
BuildGoModule,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
use std::{fs, path::PathBuf};
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
|
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
@ -6,8 +8,6 @@ use serde::Deserialize;
|
|||||||
use tokio::process::Command;
|
use tokio::process::Command;
|
||||||
use xdg::BaseDirectories;
|
use xdg::BaseDirectories;
|
||||||
|
|
||||||
use std::{fs, path::PathBuf};
|
|
||||||
|
|
||||||
use crate::utils::{CommandExt, ResultExt};
|
use crate::utils::{CommandExt, ResultExt};
|
||||||
|
|
||||||
#[derive(Default, Deserialize)]
|
#[derive(Default, Deserialize)]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use clap::Parser;
|
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use clap::Parser;
|
||||||
|
|
||||||
/// Generate Nix packages with hash prefetching, license detection, and more
|
/// Generate Nix packages with hash prefetching, license detection, and more
|
||||||
/// https://github.com/nix-community/nix-init
|
/// https://github.com/nix-community/nix-init
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
use anyhow::Result;
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
collections::{BTreeMap, BTreeSet},
|
collections::{BTreeMap, BTreeSet},
|
||||||
fmt::Write,
|
fmt::Write,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct AllInputs {
|
pub struct AllInputs {
|
||||||
pub native_build_inputs: Inputs,
|
pub native_build_inputs: Inputs,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
use std::{borrow::Cow, fmt::Write, fs::File, path::Path};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use heck::ToLowerCamelCase;
|
use heck::ToLowerCamelCase;
|
||||||
use regex::{Captures, Regex};
|
use regex::{Captures, Regex};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use std::{borrow::Cow, fmt::Write, fs::File, path::Path};
|
|
||||||
|
|
||||||
use crate::utils::ResultExt;
|
use crate::utils::ResultExt;
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
mod deps;
|
mod deps;
|
||||||
mod goreleaser;
|
mod goreleaser;
|
||||||
|
|
||||||
pub use goreleaser::write_ldflags;
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{BufRead, BufReader},
|
io::{BufRead, BufReader},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub use goreleaser::write_ldflags;
|
||||||
|
|
||||||
use crate::{inputs::AllInputs, lang::go::deps::load_go_dependency};
|
use crate::{inputs::AllInputs, lang::go::deps::load_go_dependency};
|
||||||
|
|
||||||
pub fn load_go_dependencies(inputs: &mut AllInputs, go_sum: &File) {
|
pub fn load_go_dependencies(inputs: &mut AllInputs, go_sum: &File) {
|
||||||
|
@ -1,9 +1,3 @@
|
|||||||
use chumsky::{error::EmptyErr, extra::Err, primitive::end, Parser};
|
|
||||||
use heck::{AsKebabCase, ToKebabCase};
|
|
||||||
use pep_508::{Comparator, Dependency, Marker, Operator, Variable};
|
|
||||||
use serde::Deserialize;
|
|
||||||
use serde_with::{serde_as, DefaultOnError};
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::{BTreeMap, BTreeSet},
|
collections::{BTreeMap, BTreeSet},
|
||||||
fs::{self, File},
|
fs::{self, File},
|
||||||
@ -12,6 +6,12 @@ use std::{
|
|||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use chumsky::{error::EmptyErr, extra::Err, primitive::end, Parser};
|
||||||
|
use heck::{AsKebabCase, ToKebabCase};
|
||||||
|
use pep_508::{Comparator, Dependency, Marker, Operator, Variable};
|
||||||
|
use serde::Deserialize;
|
||||||
|
use serde_with::{serde_as, DefaultOnError};
|
||||||
|
|
||||||
use crate::{inputs::AllInputs, license::parse_spdx_expression, utils::ResultExt};
|
use crate::{inputs::AllInputs, license::parse_spdx_expression, utils::ResultExt};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -2,6 +2,15 @@ mod deps;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
collections::BTreeMap,
|
||||||
|
fmt::{Display, Write},
|
||||||
|
fs::File,
|
||||||
|
io::{self, Write as _},
|
||||||
|
path::Path,
|
||||||
|
process::Command,
|
||||||
|
};
|
||||||
|
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
use cargo::{
|
use cargo::{
|
||||||
core::{
|
core::{
|
||||||
@ -17,17 +26,8 @@ use indoc::writedoc;
|
|||||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use rustyline::{history::History, Editor};
|
use rustyline::{history::History, Editor};
|
||||||
use std::process::Command;
|
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
use std::{
|
|
||||||
collections::BTreeMap,
|
|
||||||
fmt::{Display, Write},
|
|
||||||
fs::File,
|
|
||||||
io::{self, Write as _},
|
|
||||||
path::Path,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
cmd::NURL,
|
cmd::NURL,
|
||||||
inputs::AllInputs,
|
inputs::AllInputs,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
use std::fs::{copy, create_dir, File};
|
||||||
|
|
||||||
use heck::AsKebabCase;
|
use heck::AsKebabCase;
|
||||||
use insta::assert_debug_snapshot;
|
use insta::assert_debug_snapshot;
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
@ -5,8 +7,6 @@ use tempfile::tempdir;
|
|||||||
use super::resolve_workspace;
|
use super::resolve_workspace;
|
||||||
use crate::{inputs::AllInputs, lang::rust::load_rust_dependencies};
|
use crate::{inputs::AllInputs, lang::rust::load_rust_dependencies};
|
||||||
|
|
||||||
use std::fs::{copy, create_dir, File};
|
|
||||||
|
|
||||||
macro_rules! tests {
|
macro_rules! tests {
|
||||||
($($name:ident)+) => {
|
($($name:ident)+) => {
|
||||||
$(
|
$(
|
||||||
|
18
src/main.rs
18
src/main.rs
@ -10,6 +10,15 @@ mod macros;
|
|||||||
mod prompt;
|
mod prompt;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
cmp::Ordering,
|
||||||
|
collections::{BTreeMap, BTreeSet},
|
||||||
|
fmt::Write as _,
|
||||||
|
fs::{create_dir_all, metadata, read_dir, read_to_string, File},
|
||||||
|
io::{stderr, BufRead, BufReader, Write as _},
|
||||||
|
path::PathBuf,
|
||||||
|
};
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use askalono::{IdentifiedLicense, ScanResult, ScanStrategy, TextData};
|
use askalono::{IdentifiedLicense, ScanResult, ScanStrategy, TextData};
|
||||||
use bstr::{ByteSlice, ByteVec};
|
use bstr::{ByteSlice, ByteVec};
|
||||||
@ -30,15 +39,6 @@ use tracing::debug;
|
|||||||
use tracing_subscriber::EnvFilter;
|
use tracing_subscriber::EnvFilter;
|
||||||
use zip::ZipArchive;
|
use zip::ZipArchive;
|
||||||
|
|
||||||
use std::{
|
|
||||||
cmp::Ordering,
|
|
||||||
collections::{BTreeMap, BTreeSet},
|
|
||||||
fmt::Write as _,
|
|
||||||
fs::{create_dir_all, metadata, read_dir, read_to_string, File},
|
|
||||||
io::{stderr, BufRead, BufReader, Write as _},
|
|
||||||
path::PathBuf,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
build::{BuildType, PythonFormat, RustVendor},
|
build::{BuildType, PythonFormat, RustVendor},
|
||||||
cfg::load_config,
|
cfg::load_config,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
use std::{fmt::Display, future::Future, io::BufRead, pin::Pin, process::Output};
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
use tokio::process::Command;
|
use tokio::process::Command;
|
||||||
use tracing::{error, info, warn};
|
use tracing::{error, info, warn};
|
||||||
|
|
||||||
use std::{fmt::Display, future::Future, io::BufRead, pin::Pin, process::Output};
|
|
||||||
|
|
||||||
use crate::cmd::NIX;
|
use crate::cmd::NIX;
|
||||||
|
|
||||||
pub const FAKE_HASH: &str = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
pub const FAKE_HASH: &str = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
||||||
|
Loading…
Reference in New Issue
Block a user