Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Breaking Changes v4.0.0 #1028

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fc676f6
Removed ::= cff-release-today
kevinmatthes Jan 5, 2024
b7c99fd
Removed ::= README: documentation of cff-release-today
kevinmatthes Jan 5, 2024
48cb8bd
Removed ::= CFF: project keywords ``cffrel``, ``cffreleasetoday``, a…
kevinmatthes Jan 5, 2024
de432d4
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 6, 2024
9ac90ed
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 6, 2024
d9a12e6
[GitHub Actions] just logo
github-actions[bot] Jan 6, 2024
f1cd546
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 6, 2024
27b1d7d
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 6, 2024
653141b
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 8, 2024
9f0810b
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 8, 2024
0afc6e0
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 9, 2024
efbbea5
[GitHub Actions] just logo
github-actions[bot] Jan 9, 2024
f99249e
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 10, 2024
0c6d80e
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 12, 2024
5f2b590
[GitHub Actions] just logo
github-actions[bot] Jan 12, 2024
3a3d0d5
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 14, 2024
86eb794
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 16, 2024
4a30edf
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 18, 2024
3e29c99
Removed ::= comment-changes: deprecated options ``-S`` and ``-T``
kevinmatthes Jan 18, 2024
b6f92c4
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 22, 2024
7466171
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 30, 2024
ba7fb94
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jan 30, 2024
984cf2c
Removed ::= PatternWriter::truncate
kevinmatthes Jan 30, 2024
96e743d
Removed ::= PatternWriter::truncate_silently
kevinmatthes Jan 30, 2024
27c959b
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 2, 2024
ec1c043
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 4, 2024
0fbc2d6
Removed ::= PatternIOProcessor::io
kevinmatthes Feb 4, 2024
693e3ff
Removed ::= PatternIOProcessor::io_silent
kevinmatthes Feb 4, 2024
1237e99
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 4, 2024
f661de1
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 8, 2024
3b9925c
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 16, 2024
5b01251
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 16, 2024
be66170
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 18, 2024
0205811
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 18, 2024
41b2688
Merge branch 'main' into feature/v4.0.0
kevinmatthes Feb 28, 2024
04d0a21
Merge branch 'main' into feature/v4.0.0
kevinmatthes Mar 1, 2024
2ed57f2
Merge branch 'main' into feature/v4.0.0
kevinmatthes Mar 8, 2024
0cc0d7c
Merge branch 'main' into feature/v4.0.0
kevinmatthes Mar 17, 2024
9859e2c
Merge branch 'main' into feature/v4.0.0
kevinmatthes Apr 15, 2024
dfeb7d4
Merge branch 'main' into feature/v4.0.0
kevinmatthes May 27, 2024
4c490b9
Merge branch 'main' into feature/v4.0.0
kevinmatthes Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/aeruginous.cff
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ keywords:
- cffcreate
- cffref
- cffreference
- cffrel
- cffreleasetoday
- cff-create
- cff-ref
- cff-reference
- cff-rel
- cff-release-today
- changelog
- citation-file-format
Expand Down
45 changes: 1 addition & 44 deletions src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
| |
\******************************************************************************/

use crate::{AppendAsLine, PatternWriter};
use clap::{Parser, Subcommand};
use std::{io::BufRead, path::PathBuf};
use sysexits::Result;

/// The supported application modes.
///
Expand All @@ -38,19 +35,6 @@ pub enum Action {
/// Extract the citation information from a given and valid CFF file.
Cffreference(crate::Cffreference),

/// ⚠️ DEPRECATED.
///
/// Increment the release date in CFFs.
///
/// This application mode is deprecated. Please use `aeruginous
/// increment-version [-e|-R] <FILE>` instead.
#[command(aliases = ["cffrel", "cff-rel", "cffreleasetoday"])]
#[deprecated(since = "3.6.2", note = "use `IncrementVersion` instead")]
CffReleaseToday {
/// The file to work on.
file_to_edit: PathBuf,
},

/// Create comments on the commits of a branch in this repository.
CommentChanges(crate::CommentChanges),

Expand Down Expand Up @@ -91,38 +75,11 @@ impl Action {
/// # Errors
///
/// See [`sysexits::ExitCode`].
pub fn run(&self) -> Result<()> {
pub fn run(&self) -> sysexits::Result<()> {
match self {
#[cfg(feature = "cff-create")]
Self::CffCreate(c) => c.main(),
Self::Cffreference(c) => c.main(),
#[allow(deprecated)]
Self::CffReleaseToday { file_to_edit } => {
crate::ceprintlns!(
"DEPRECATED"!Red,
"Please use `increment-version` instead."
);

let mut buffer = String::new();

for line in
std::io::BufReader::new(std::fs::File::open(file_to_edit)?)
.lines()
{
let line = line?;

if line.starts_with("date-released:") {
buffer.append_as_line(format!(
"date-released: {}",
chrono::Local::now().format("%Y-%m-%d")
));
} else {
buffer.append_as_line(line);
}
}

file_to_edit.truncate(Box::new(buffer))
}
Self::CommentChanges(c) => c.main(),
Self::Complain(c) => c.main(),
/*
Expand Down
54 changes: 1 addition & 53 deletions src/changelog/comment_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,6 @@ pub struct CommentChanges {
#[arg(long, short = '@')]
stop: Vec<String>,

/// ⚠️ DEPRECATED.
///
/// The commit to stop at.
///
/// This option is deprecated. Please use `-@` instead.
#[arg(long, short = 'S')]
#[deprecated(since = "3.7.4", note = "use `Self::stop` instead")]
stop_at: Option<Oid>,

/// ⚠️ DEPRECATED.
///
/// The tag to stop at.
///
/// This option is deprecated. Please use `-@` instead.
#[arg(long, short = 'T')]
#[deprecated(since = "3.7.4", note = "use `Self::stop` instead")]
tag: Option<String>,

/// The hyperlinks' targets.
#[arg(long, short)]
target: Vec<String>,
Expand Down Expand Up @@ -140,8 +122,6 @@ impl CommentChanges {
link: Vec::new(),
output_directory: ".".to_string(),
stop: Vec::new(),
stop_at: None,
tag: None,
target: Vec::new(),
}
}
Expand Down Expand Up @@ -324,39 +304,7 @@ impl Logic {
},
|r| {
self.repository = Some(r);
self.analyse_stop_condition()?;

if let Some(oid) = &self.cli.stop_at {
self.stop_conditions.push(*oid);
}

if let Some(tag) = &self.cli.tag {
if let Some(repository) = &self.repository {
if let Ok(target) =
repository.resolve_reference_from_short_name(tag)
{
if target.is_tag() {
if let Some(oid) = target.target() {
self.stop_conditions.push(oid);
Ok(())
} else {
eprintln!("`{tag}` cannot be used as stop condition."); // #[aeruginous::mercy::0003]
Err(ExitCode::Usage)
}
} else {
eprintln!("{tag} does not seem to be a tag.");
Err(ExitCode::Usage)
}
} else {
eprintln!("Tag {tag} does not seem to exist.");
Err(ExitCode::Usage)
}
} else {
Err(ExitCode::Software)
}
} else {
Ok(())
}
self.analyse_stop_condition()
},
)
}
Expand Down
17 changes: 0 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
//! 1. [Supported Subcommands](#supported-subcommands)
//! 1. [`cff-create`](#cff-create)
//! 1. [`cffreference`](#cffreference)
//! 1. ⚠️ [`cff-release-today`](#cff-release-today) (deprecated)
//! 1. [`comment-changes`](#comment-changes)
//! 1. [`complain`](#complain)
//! 1. [`increment-version`](#increment-version)
Expand All @@ -82,7 +81,6 @@
//! <!--
//! 1. [`cff-create`](#cff-create)
//! 1. [`cffreference`](#cffreference)
//! 1. ⚠️ [`cff-release-today`](#cff-release-today) (deprecated)
//! 1. [`comment-changes`](#comment-changes)
//! 1. [`complain`](#complain)
//! 1. [`graph-description`](#graph-description)
Expand Down Expand Up @@ -259,21 +257,6 @@
//! from [`std::io::Stdin`]. Likewise, omitting the output file will cause
//! `cffreference` to write to [`std::io::Stdout`].
//!
//! ### `cff-release-today`
//!
//! ⚠️ This mode is deprecated. Please use
//! [`increment-version`](#increment-version) instead. ⚠️
//!
//! > To be called with:
//! >
//! > - `cffrel`
//! > - `cff-rel`
//! > - `cffreleasetoday`
//! > - `cff-release-today`
//!
//! This subcommand will set the release date in the given `CITATION.cff` to the
//! present day.
//!
//! ### `comment-changes`
//!
//! > To be called with:
Expand Down
30 changes: 0 additions & 30 deletions src/pattern/io_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,6 @@ pub trait IOProcessor {
truncate: bool,
) -> Result<()>;

/// Truncate the output stream and write error messages.
///
/// # Errors
///
/// See [`Self::behaviour`].
#[allow(deprecated)]
#[deprecated(since = "3.7.7", note = "use `aeruginous_io` instead")]
fn io(
&self,
input: impl ReadFile,
output: impl PatternWriter,
) -> Result<()> {
self.behaviour(input, output, false, true, true)
}

/// Do not truncate the output stream but write error messages.
///
/// # Errors
Expand Down Expand Up @@ -110,21 +95,6 @@ pub trait IOProcessor {
self.behaviour(input, output, true, false, false)
}

/// Truncate the output stream but do not write error messages.
///
/// # Errors
///
/// See [`Self::behaviour`].
#[allow(deprecated)]
#[deprecated(since = "3.7.7", note = "use `aeruginous_io` instead")]
fn io_silent(
&self,
input: impl ReadFile,
output: impl PatternWriter,
) -> Result<()> {
self.behaviour(input, output, false, false, true)
}

/// Edit the output stream and write error messages.
///
/// # Errors
Expand Down
20 changes: 0 additions & 20 deletions src/pattern/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,6 @@ pub trait Writer {
truncate: bool,
) -> Result<()>;

/// Truncate the stream, write the buffer's data, and print error messages.
///
/// # Errors
///
/// See [`Self::behaviour`].
#[deprecated(since = "3.7.6", note = "use `aeruginous_io` instead")]
fn truncate(&self, buffer: Box<dyn PatternBuffer>) -> Result<()> {
self.behaviour(buffer, false, true, true)
}

/// Truncate the stream and write the buffer's data without error messages.
///
/// # Errors
///
/// See [`Self::behaviour`].
#[deprecated(since = "3.7.6", note = "use `aeruginous_io` instead")]
fn truncate_silently(&self, buffer: Box<dyn PatternBuffer>) -> Result<()> {
self.behaviour(buffer, false, false, true)
}

/// Edit the stream, write the buffer's data, and print error messages.
///
/// # Errors
Expand Down
12 changes: 0 additions & 12 deletions tests/pattern_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ macro_rules! make_test {
),
Ok(())
);
assert_eq!(
std::io::$function().truncate(
Box::new(stringify!($function).to_string())
),
Ok(())
);
assert_eq!(
std::io::$function().truncate_silently(
Box::new(stringify!($function).to_string())
),
Ok(())
);
assert_eq!(
std::io::$function().write(
Box::new(stringify!($function).to_string())
Expand Down