Compare commits

..

No commits in common. "main" and "v0.4.0" have entirely different histories.
main ... v0.4.0

26 changed files with 602 additions and 2142 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
target/
.cuddle/
.env
crates/cuddle-please/testdata/git-found/

View File

@ -6,44 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.6.0] - 2025-01-09
### Added
- ignore git found
- enable commit bodies in changelog and fixes general warnings and updates (#49)
Allows commit bodies to show up in release notes, this is something I'd prefer as my releases are usually short, and I'd like to see these as I don't use pull requests as often, and often miss the context, as I don't link to commits currently.
Also fixes a lot of warnings and reintroduces failing tests, still not perfect, but better than before.
Co-authored-by: kjuulh <contact@kjuulh.io>
Co-committed-by: kjuulh <contact@kjuulh.io>
- removed tests for now
- update deps
- update
### Docs
- add simple docs
### Fixed
- multi line commit bodies should be prefixed with correct amount of spaces
this allows multi line commit messages to be displayed in a nice manner
### Other
- *(deps)* update rust crate serde to v1.0.217
- *(deps)* update rust crate serde to v1.0.216
- *(deps)* update rust crate tracing-subscriber to v0.3.19
- *(deps)* update rust crate tracing to v0.1.41
- *(deps)* update rust crate serde to v1.0.215
- *(deps)* update rust crate serde to v1.0.214
- *(deps)* update rust crate serde to v1.0.213
- *(deps)* update rust crate serde to v1.0.210
## [0.5.0] - 2024-04-09
### Added
- stuff
- with rust version
- add rust actions
## [0.4.0] - 2024-04-08
### Added
@ -141,7 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- add mkdocs build
- add basic version
- update with repository
- add publish to rest
- add publishable to rest
- hack get in control of log level
### Docs

2170
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,11 @@
[workspace]
members = ["crates/*"]
members = [
"crates/cuddle-please",
"crates/cuddle-please-frontend",
"crates/cuddle-please-commands",
"crates/cuddle-please-misc",
"crates/cuddle-please-release-strategy"
]
resolver = "2"
[workspace.dependencies]
@ -8,30 +14,24 @@ cuddle-please-frontend = { path = "crates/cuddle-please-frontend", version = "0.
cuddle-please-commands = { path = "crates/cuddle-please-commands", version = "0.1.0" }
cuddle-please-misc = { path = "crates/cuddle-please-misc", version = "0.1.0" }
cuddle-please-release-strategy = { path = "crates/cuddle-please-release-strategy", version = "0.1.0" }
cuddle-please-actions = { path = "crates/cuddle-please-actions", version = "0.1.0" }
anyhow = { version = "1.0.81" }
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
dotenvy = { version = "0.15.7" }
clap = { version = "4.5.4", features = ["derive", "env"] }
dotenv = { version = "0.15.0" }
url = { version = "2.5.0" }
serde_yaml = { version = "0.9.34+deprecated" }
yaml-rust2 = { version = "0.8.0" }
serde = { version = "1", features = ["derive"] }
semver = "1.0.22"
conventional_commit_parser = "0.9.4"
tempdir = "0.3.7"
reqwest = { version = "0.12.3" }
git-cliff-core = "2.7.0"
git-cliff-core = "2.2.0"
regex = "1.10.4"
chrono = "0.4.37"
lazy_static = "1.4.0"
parse-changelog = "0.6.6"
toml_edit = "0.22.9"
tracing-test = "0.2"
pretty_assertions = "1.4"
[workspace.package]
version = "0.6.0"

View File

@ -40,12 +40,12 @@ See docs for more information about installation and some such
- [x] Fix: 0.0.0 -> **v**0.0.0
- [ ] Add release strategies
- [x] Add reporter for PR and Repositories
- [ ] Add reporter for PR and Repositories
- [ ] Add inquire for missing values when needed (when not running in ci or have a proper tty)
- [x] Break down cuddle-please-misc
- [ ] Break down cuddle-please-misc
- [ ] ci(release): Add cuddle-please release artifacts for the different os and so on.
### 0.x Milestone
- [ ] Add github support
- [ ] Add custom strategies
- [x] Add more granular tests
- [ ] Add more granular tests

View File

@ -1,19 +0,0 @@
[package]
name = "cuddle-please-actions"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publish = true
[dependencies]
anyhow.workspace = true
tracing.workspace = true
semver.workspace = true
toml_edit.workspace = true
yaml-rust2.workspace = true
[dev-dependencies]
pretty_assertions.workspace = true

View File

@ -1,9 +0,0 @@
use semver::Version;
use crate::ActionConfig;
pub trait Action {
fn enabled(&self, config: &ActionConfig) -> anyhow::Result<bool>;
fn name(&self) -> String;
fn execute(&self, version: &Version) -> anyhow::Result<()>;
}

View File

@ -1,49 +0,0 @@
use std::ops::Deref;
use anyhow::Context;
pub enum ActionConfig {
Actual { doc: yaml_rust2::Yaml },
None,
}
impl Deref for ActionConfig {
type Target = yaml_rust2::Yaml;
fn deref(&self) -> &Self::Target {
match &self {
ActionConfig::Actual { doc } => doc,
ActionConfig::None => &yaml_rust2::Yaml::BadValue,
}
}
}
impl TryFrom<&str> for ActionConfig {
type Error = anyhow::Error;
fn try_from(value: &str) -> Result<Self, Self::Error> {
let mut cuddle = yaml_rust2::YamlLoader::load_from_str(value)?;
if cuddle.len() != 1 {
anyhow::bail!("cuddle.yaml can only be 1 document wide");
}
let doc = cuddle.pop().unwrap();
let doc = doc["please"]["actions"].clone();
if doc.is_badvalue() {
return Ok(Self::None);
}
Ok(Self::Actual { doc })
}
}
impl ActionConfig {
pub fn parse() -> anyhow::Result<Self> {
let cuddle_yaml =
std::fs::read_to_string("cuddle.yaml").context("failed to read cuddle.yaml")?;
Self::try_from(cuddle_yaml.as_str())
}
}

View File

@ -1,45 +0,0 @@
pub(crate) mod actions;
mod config;
mod rust_action;
use std::{ops::Deref, sync::Arc};
use catalog::RustAction;
pub use config::ActionConfig;
use semver::Version;
pub mod catalog {
pub use crate::rust_action::*;
}
pub struct Action(Arc<dyn actions::Action>);
impl Deref for Action {
type Target = Arc<dyn actions::Action>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
pub struct Actions(Vec<Action>);
impl Actions {
pub fn from_cuddle() -> anyhow::Result<Self> {
let config = ActionConfig::parse()?;
Ok(Self(
vec![Action(Arc::new(RustAction::new()))]
.into_iter()
.filter(|a| a.enabled(&config).unwrap_or_default())
.collect(),
))
}
pub fn execute(&self, version: &Version) -> anyhow::Result<()> {
for action in &self.0 {
action.execute(version)?;
}
Ok(())
}
}

View File

@ -1,235 +0,0 @@
use std::io::Write;
use crate::{actions::Action, ActionConfig};
#[derive(Default, Clone)]
pub struct RustAction {}
impl RustAction {
pub fn new() -> Self {
Self {}
}
fn execute_content(
&self,
version: &semver::Version,
cargo_content: &str,
) -> anyhow::Result<String> {
tracing::trace!("parsing Cargo.toml file as tolm");
let mut cargo_doc = cargo_content.parse::<toml_edit::DocumentMut>()?;
tracing::debug!(
"updating cargo workspace package version to {}",
version.to_string()
);
let workspace = if cargo_doc.contains_table("workspace") {
cargo_doc["workspace"].as_table_mut().unwrap()
} else {
let mut t = toml_edit::Table::new();
t.set_implicit(true);
cargo_doc["workspace"] = toml_edit::Item::Table(t);
cargo_doc["workspace"].as_table_mut().unwrap()
};
let package = workspace["package"].or_insert(toml_edit::table());
package["version"] = toml_edit::value(version.to_string());
Ok(cargo_doc.to_string())
}
}
impl Action for RustAction {
fn enabled(&self, config: &ActionConfig) -> anyhow::Result<bool> {
if let Ok(v) = std::env::var("CUDDLE_PLEASE_RUST_ACTION") {
if let Ok(true) = v.parse::<bool>() {
return Ok(true);
}
}
let val = &config[self.name().as_str()];
if val.is_badvalue() {
return Ok(false);
}
Ok(val.as_bool().unwrap_or(true))
}
fn name(&self) -> String {
"rust".into()
}
fn execute(&self, version: &semver::Version) -> anyhow::Result<()> {
tracing::info!(
"running rust action for version: {} and file: Cargo.toml",
version.to_string()
);
let path = std::path::PathBuf::from("Cargo.toml");
tracing::trace!("reading Cargo.toml");
let file = match std::fs::read_to_string(&path) {
Ok(file) => file,
Err(e) => match e.kind() {
std::io::ErrorKind::NotFound => {
anyhow::bail!("err: Cargo.toml was not found in dir")
}
_ => Err(e)?,
},
};
let cargo_doc = self.execute_content(version, &file)?;
let mut cargo_file = std::fs::File::create(&path)?;
cargo_file.write_all(cargo_doc.as_bytes())?;
cargo_file.sync_all()?;
tracing::debug!("finished writing cargo file");
Ok(())
}
}
#[cfg(test)]
mod test {
use semver::{BuildMetadata, Prerelease};
use crate::{actions::Action, ActionConfig};
use super::RustAction;
#[test]
fn test_is_enabled() {
let config = ActionConfig::try_from(
r#"
please:
actions:
rust: true
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(enabled)
}
#[test]
fn test_is_disabled_by_default() {
let config = ActionConfig::try_from(
r#"
please:
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(!enabled)
}
#[test]
fn test_is_disabled() {
let config = ActionConfig::try_from(
r#"
please:
actions:
rust: false
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(!enabled)
}
#[test]
fn test_missing_value_is_enabled() {
let config = ActionConfig::try_from(
r#"
please:
actions:
rust:
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(enabled)
}
#[test]
fn test_can_edit_empty_file() {
let output = RustAction::default()
.execute_content(
&semver::Version {
major: 0,
minor: 1,
patch: 0,
pre: Prerelease::default(),
build: BuildMetadata::default(),
},
"",
)
.unwrap();
pretty_assertions::assert_eq!(
r#"[workspace.package]
version = "0.1.0"
"#,
&output,
)
}
#[test]
fn test_only_edits_stuff() {
let input = r#"
[workspace]
members = ["."]
[package]
something = {some = "something"}
# Some comment
[workspace.package]
version = "0.0.0" # some comment
readme = "../../"
"#;
let output = RustAction::default()
.execute_content(
&semver::Version {
major: 0,
minor: 1,
patch: 0,
pre: Prerelease::default(),
build: BuildMetadata::default(),
},
input,
)
.unwrap();
pretty_assertions::assert_eq!(
r#"
[workspace]
members = ["."]
[package]
something = {some = "something"}
# Some comment
[workspace.package]
version = "0.1.0"
readme = "../../"
"#,
&output,
)
}
}

View File

@ -6,19 +6,18 @@ readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publish = true
publishable = true
[dependencies]
cuddle-please-frontend.workspace = true
cuddle-please-misc.workspace = true
cuddle-please-actions.workspace = true
anyhow.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
dotenvy.workspace = true
dotenv.workspace = true
serde_yaml.workspace = true
serde.workspace = true
reqwest = { workspace = true, features = ["blocking", "json"] }

View File

@ -6,7 +6,6 @@ use std::{
};
use clap::{Parser, Subcommand};
use cuddle_please_actions::Actions;
use cuddle_please_frontend::{gatheres::ConfigArgs, PleaseConfig, PleaseConfigBuilder};
use cuddle_please_misc::{
ConsoleUi, DynRemoteGitClient, DynUi, GiteaClient, GlobalArgs, LocalGitClient, StdinFn,
@ -91,27 +90,26 @@ impl Command {
}
pub fn execute(self, current_dir: Option<&Path>) -> anyhow::Result<()> {
if let Some(c) = &self.commands {
match c {
Commands::Release {} => {
let (config, git_client, gitea_client, actions) = self.get_deps(current_dir)?;
ReleaseCommandHandler::new(self.ui, config, git_client, gitea_client, actions)
.execute(self.global.dry_run)?;
}
Commands::Config { command } => {
let (config, _, _, _) = self.get_deps(current_dir)?;
ConfigCommandHandler::new(self.ui, config).execute(command)?;
}
Commands::Gitea { command } => {
let (config, _, gitea_client, _) = self.get_deps(current_dir)?;
GiteaCommandHandler::new(self.ui, config, gitea_client)
.execute(command, self.global.token.expect("token to be set").deref())?;
}
Commands::Doctor {} => {
DoctorCommandHandler::new(self.ui).execute()?;
}
match &self.commands {
Some(Commands::Release {}) => {
let (config, git_client, gitea_client) = self.get_deps(current_dir)?;
ReleaseCommandHandler::new(self.ui, config, git_client, gitea_client)
.execute(self.global.dry_run)?;
}
Some(Commands::Config { command }) => {
let (config, _, _) = self.get_deps(current_dir)?;
ConfigCommandHandler::new(self.ui, config).execute(command)?;
}
Some(Commands::Gitea { command }) => {
let (config, _, gitea_client) = self.get_deps(current_dir)?;
GiteaCommandHandler::new(self.ui, config, gitea_client)
.execute(command, self.global.token.expect("token to be set").deref())?;
}
Some(Commands::Doctor {}) => {
DoctorCommandHandler::new(self.ui).execute()?;
}
None => {}
}
Ok(())
@ -120,7 +118,7 @@ impl Command {
fn get_deps(
&self,
current_dir: Option<&Path>,
) -> anyhow::Result<(PleaseConfig, VcsClient, DynRemoteGitClient, Actions)> {
) -> anyhow::Result<(PleaseConfig, VcsClient, DynRemoteGitClient)> {
let config = self.build_config(current_dir)?;
let git_client =
self.get_git(&config, self.global.token.clone().expect("token to be set"))?;
@ -142,9 +140,7 @@ impl Command {
tracing_subscriber::fmt().with_env_filter(env_filter).init();
}
let actions = self.get_actions()?;
Ok((config, git_client, gitea_client, actions))
Ok((config, git_client, gitea_client))
}
fn build_config(&self, current_dir: Option<&Path>) -> Result<PleaseConfig, anyhow::Error> {
@ -187,10 +183,6 @@ impl Command {
)),
}
}
fn get_actions(&self) -> anyhow::Result<Actions> {
Actions::from_cuddle()
}
}
#[derive(Debug, Clone, Subcommand)]

View File

@ -1,6 +1,3 @@
use std::path::Path;
use cuddle_please_actions::Actions;
use cuddle_please_frontend::PleaseConfig;
use ::semver::Version;
@ -16,7 +13,6 @@ pub struct ReleaseCommandHandler {
config: PleaseConfig,
git_client: VcsClient,
gitea_client: DynRemoteGitClient,
actions: Actions,
}
impl ReleaseCommandHandler {
@ -25,14 +21,12 @@ impl ReleaseCommandHandler {
config: PleaseConfig,
git_client: VcsClient,
gitea_client: DynRemoteGitClient,
actions: Actions,
) -> Self {
Self {
ui,
config,
git_client,
gitea_client,
actions,
}
}
@ -75,8 +69,6 @@ impl ReleaseCommandHandler {
let (changelog_placement, changelog, changelog_last_changes) =
compose_changelog(&commit_strs, &next_version, source)?;
self.actions.execute(&next_version)?;
if let Some(first_commit) = commit_strs.first() {
if first_commit.contains("chore(release): ") {
tracing::trace!("creating release");
@ -130,7 +122,6 @@ impl ReleaseCommandHandler {
Ok(())
}
#[allow(clippy::too_many_arguments)]
fn create_pull_request(
&self,
changelog_placement: std::path::PathBuf,
@ -228,7 +219,7 @@ impl ReleaseCommandHandler {
fn compose_changelog(
commit_strs: &Vec<String>,
next_version: &Version,
source: &Path,
source: &std::path::PathBuf,
) -> Result<(std::path::PathBuf, String, Option<String>), anyhow::Error> {
let builder = ChangeLogBuilder::new(commit_strs, next_version.to_string()).build();
let changelog_placement = source.join("CHANGELOG.md");

View File

@ -6,14 +6,14 @@ readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publish = true
publishable = true
[dependencies]
anyhow.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
dotenvy.workspace = true
dotenv.workspace = true
serde_yaml.workspace = true
serde.workspace = true
chrono.workspace = true

View File

@ -28,8 +28,14 @@ pub struct PleaseConfigBuilder {
impl PleaseConfigBuilder {
pub fn merge(&mut self, config: &PleaseConfigBuilder) -> &Self {
let config = config.clone();
let mut fproject = self.project.clone().unwrap_or_default();
let mut fsettings = self.settings.clone().unwrap_or_default();
let mut fproject = match self.project.clone() {
None => PleaseProjectConfigBuilder::default(),
Some(project) => project,
};
let mut fsettings = match self.settings.clone() {
None => PleaseSettingsConfigBuilder::default(),
Some(settings) => settings,
};
if let Some(project) = config.project {
if let Some(owner) = project.owner {

View File

@ -6,7 +6,7 @@ readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publish = true
publishable = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -15,7 +15,7 @@ anyhow.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
dotenvy.workspace = true
dotenv.workspace = true
serde_yaml.workspace = true
serde.workspace = true
reqwest = { workspace = true, features = ["blocking", "json"] }
@ -29,9 +29,6 @@ chrono.workspace = true
lazy_static.workspace = true
parse-changelog.workspace = true
# Cliff depends on 13.1.0, which is a broken release
cacache = "=13.0.0"
[dev-dependencies]
tracing-test = { workspace = true, features = ["no-env-filter"] }
pretty_assertions.workspace = true

View File

@ -3,7 +3,7 @@ use chrono::{DateTime, NaiveDate, Utc};
use git_cliff_core::{
changelog::Changelog,
commit::Commit,
config::{Bump, ChangelogConfig, CommitParser, Config, GitConfig, RemoteConfig},
config::{Bump, ChangelogConfig, CommitParser, Config, GitConfig, Remote, RemoteConfig},
release::Release,
};
use regex::Regex;
@ -77,9 +77,6 @@ impl ChangeLogBuilder {
commit_id: None,
timestamp,
previous: None,
message: None,
repository: None,
extra: None,
},
config: self.config,
release_link: self.release_link,
@ -183,7 +180,6 @@ fn default_commit_parsers() -> Vec<CommitParser> {
field: None,
pattern: None,
sha: None,
footer: None,
}
}
@ -205,7 +201,6 @@ fn default_commit_parsers() -> Vec<CommitParser> {
field: None,
pattern: None,
sha: None,
footer: None,
},
]
}
@ -226,8 +221,6 @@ fn default_changelog_config(header: Option<String>, release_link: Option<&str>)
footer: None,
trim: Some(true),
postprocessors: None,
render_always: None,
output: None,
}
}
@ -243,13 +236,6 @@ fn default_changelog_body_config(release_link: Option<&str>) -> String {
{% else -%}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message }}
{% endif -%}
{%- if commit.body -%}
{%- if commit.body | length > 0 -%}
{% for line in commit.body | trim | split(pat="\n") -%}
{% raw %} {% endraw %}{{ line | trim }}
{% endfor -%}
{% endif -%}
{% endif -%}
{% endfor -%}
{% endfor %}"#;
@ -522,10 +508,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#[test]
fn generates_changelog() {
let commits: Vec<&str> = vec![
"feat: some feature
some body
and another line",
"feat: some feature",
"some random commit",
"fix: some fix",
"chore(scope): some chore",
@ -546,8 +529,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- some feature
some body
and another line
### Fixed
- some fix

View File

@ -602,7 +602,7 @@ mod test {
let (expected, actual) = get_commits("second-sha".into()).unwrap();
assert_eq!(
expected.first().unwrap().clone().as_slice(),
expected.get(0).unwrap().clone().as_slice(),
actual.as_slice()
);
}

View File

@ -1,6 +1,5 @@
use crate::RemoteGitEngine;
#[derive(Default)]
pub struct LocalGitClient {}
impl LocalGitClient {

View File

@ -6,7 +6,7 @@ version = "0.1.0"
edition = "2021"
readme = "../../README.md"
license-file = "../../LICENSE"
publish = true
publishable = true
[dependencies]
anyhow.workspace = true

View File

@ -2,13 +2,11 @@ use std::path::PathBuf;
use serde::{Deserialize, Serialize};
#[allow(dead_code)]
pub struct UpdateOptions {
next_version: String,
global_changelog: String,
}
#[allow(dead_code)]
pub type Projects = Vec<Project>;
#[derive(Clone, Debug, Deserialize, Serialize)]
@ -24,7 +22,7 @@ pub enum ProjectType {
#[serde(alias = "rust_workspace")]
RustWorkspace,
#[cfg(feature = "rust-crate")]
#[serde(alias = "rust_crate")]
#[serde(alias = "json_edit")]
RustCrate,
#[cfg(feature = "toml-edit")]
#[serde(alias = "toml_edit")]
@ -37,13 +35,12 @@ pub enum ProjectType {
JsonEdit,
}
#[allow(dead_code)]
impl Project {
pub fn new(path: Option<PathBuf>, r#type: ProjectType) -> Self {
Self { path, r#type }
}
pub fn execute(&self, _options: &UpdateOptions) -> anyhow::Result<()> {
pub fn execute(&self, options: &UpdateOptions) -> anyhow::Result<()> {
match self.r#type {
#[cfg(feature = "rust-workspace")]
ProjectType::RustWorkspace => todo!(),
@ -56,5 +53,7 @@ impl Project {
#[cfg(feature = "json-edit")]
ProjectType::JsonEdit => todo!(),
}
Ok(())
}
}

View File

@ -6,7 +6,7 @@ readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publish = true
publishable = true
[dependencies]
cuddle-please-frontend.workspace = true
@ -17,7 +17,7 @@ anyhow.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
dotenvy.workspace = true
dotenv.workspace = true
serde_yaml.workspace = true
serde.workspace = true
reqwest = { workspace = true, features = ["blocking", "json"] }

View File

@ -1,7 +1,7 @@
use cuddle_please_commands::PleaseCommand;
fn main() -> anyhow::Result<()> {
dotenvy::dotenv().ok();
dotenv::dotenv().ok();
let current_dir = std::env::current_dir().ok();
let current_dir = current_dir.as_deref();

View File

@ -6,7 +6,6 @@ use tracing_test::traced_test;
use crate::common::{assert_output, get_test_data_path};
#[allow(dead_code)]
fn get_base_args<'a>() -> Vec<&'a str> {
vec![
"cuddle-please",
@ -26,7 +25,7 @@ PleaseConfig
api_url: https://some-example.gitea-instance
"#;
#[allow(dead_code)]
#[test]
#[traced_test]
fn test_config_from_current_dir() {
let args = get_base_args();
@ -40,7 +39,7 @@ fn test_config_from_current_dir() {
assert_output(ui, EXPECTED_OUTPUT, "");
}
#[allow(dead_code)]
#[test]
#[traced_test]
fn test_config_from_source_dir() {
let mut args = get_base_args();
@ -56,7 +55,7 @@ fn test_config_from_source_dir() {
assert_output(ui, EXPECTED_OUTPUT, "");
}
#[allow(dead_code)]
#[test]
#[traced_test]
fn test_config_from_stdin() {
let mut args = get_base_args();
@ -76,7 +75,7 @@ settings:
assert_output(ui, EXPECTED_OUTPUT, "");
}
#[allow(dead_code)]
#[test]
#[traced_test]
fn test_config_fails_when_not_path_is_set() {
let args = get_base_args();

View File

@ -16,18 +16,15 @@ fn test_vcs_get_noop() {
#[traced_test]
fn test_vcs_get_git_found() {
let testdata = get_test_data_path("git-found");
if let Err(e) = std::fs::create_dir_all(&testdata) {
tracing::error!("failed to create dir: {}", e);
}
if let Err(e) = std::process::Command::new("git")
.arg("init")
.arg(".")
.current_dir(&testdata)
.output()
{
println!("testdata git dir not found: {e}");
println!("{e}");
}
return;
let git = VcsClient::new_git(&testdata, None::<String>, None::<String>, "".into()).unwrap();
assert_eq!(
git,

View File

@ -16,18 +16,14 @@ please:
branch: main
settings:
api_url: https://git.front.kjuulh.io
actions:
rust:
components:
packages:
debian:
dev:
- jq
- git
release:
- jq
- git
scripts:
"mkdocs:new":