pub async fn new(args: &Args) -> Result<Arc<Self>> {
		let project_origin = args.filtering.project_origin.clone().unwrap();
		let workdir = args.command.workdir.clone().unwrap();

		let ignore_files = if args.filtering.no_discover_ignore {
			Vec::new()
		} else {
			let vcs_types = crate::dirs::vcs_types(&project_origin).await;
			crate::dirs::ignores(args, &vcs_types).await?
		};

		let mut ignores = Vec::new();

		if !args.filtering.no_default_ignore {
			ignores.extend([
				(format!("**{MAIN_SEPARATOR}.DS_Store"), None),
				(String::from("watchexec.*.log"), None),
				(String::from("*.py[co]"), None),
				(String::from("#*#"), None),
				(String::from(".#*"), None),
				(String::from(".*.kate-swp"), None),
				(String::from(".*.sw?"), None),
				(String::from(".*.sw?x"), None),
				(format!("**{MAIN_SEPARATOR}.bzr{MAIN_SEPARATOR}**"), None),
				(format!("**{MAIN_SEPARATOR}_darcs{MAIN_SEPARATOR}**"), None),
				(
					format!("**{MAIN_SEPARATOR}.fossil-settings{MAIN_SEPARATOR}**"),
					None,
				),
				(format!("**{MAIN_SEPARATOR}.git{MAIN_SEPARATOR}**"), None),
				(format!("**{MAIN_SEPARATOR}.hg{MAIN_SEPARATOR}**"), None),
				(format!("**{MAIN_SEPARATOR}.pijul{MAIN_SEPARATOR}**"), None),
				(format!("**{MAIN_SEPARATOR}.svn{MAIN_SEPARATOR}**"), None),
			]);
		}

		let whitelist = args
			.filtering
			.paths
			.iter()
			.map(std::convert::Into::into)
			.filter(|p: &PathBuf| p.is_file());

		let mut filters = args
			.filtering
			.filter_patterns
			.iter()
			.map(|f| (f.to_owned(), Some(workdir.clone())))
			.collect::<Vec<_>>();

		for filter_file in &args.filtering.filter_files {
			filters.extend(read_filter_file(filter_file).await?);
		}

		ignores.extend(
			args.filtering
				.ignore_patterns
				.iter()
				.map(|f| (f.to_owned(), Some(workdir.clone()))),
		);

		let exts = args
			.filtering
			.filter_extensions
			.iter()
			.map(|e| OsString::from(e.strip_prefix('.').unwrap_or(e)));

		info!("initialising Globset filterer");
		Ok(Arc::new(Self {
			inner: GlobsetFilterer::new(
				project_origin,
				filters,
				ignores,
				whitelist,
				ignore_files,
				exts,
			)
			.await
			.into_diagnostic()?,
			fs_events: args.filtering.filter_fs_events.clone(),
			progs: if args.filtering.filter_programs_parsed.is_empty() {
				None
			} else {
				Some(progs::FilterProgs::new(args)?)
			},
		}))
	}
Create a new filterer from the given arguments
crates/cli/src/filterer.rs