Skip to content

Commit

Permalink
change default 'wrap' setting to true
Browse files Browse the repository at this point in the history
  • Loading branch information
Canop committed Jan 19, 2023
1 parent 77b3d5b commit 35e15b0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
### next
- change default value of 'wrap' setting to true

<a name="v2.5.0"></a>
### v2.5.0 - 2023/01/19
- new `allow_failures` job parameter - Fix #99
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bacon"
version = "2.5.0"
version = "2.5.1-dev"
authors = ["dystroy <denys.seguret@gmail.com>"]
repository = "https://github.com/Canop/bacon"
description = "background rust compiler"
Expand Down
4 changes: 3 additions & 1 deletion defaults/default-prefs.toml
Expand Up @@ -9,7 +9,7 @@
# Uncomment and change the value (true/false) to
# specify whether bacon should start with lines wrapped
#
# wrap = true
# wrap = false

# In "reverse" mode, the focus is at the bottom, item
# order is reversed, and the status bar is on top
Expand All @@ -20,6 +20,8 @@
# This is equivalent to always adding -e to bacon commands
# but can still be cancelled on specific launches with -E
#
# See https://dystroy.org/bacon/config/#export-locations
#
# export_locations = true

# Uncomment and change the key-bindings you want to define
Expand Down
5 changes: 4 additions & 1 deletion src/mission.rs
Expand Up @@ -113,7 +113,10 @@ impl<'s> Mission<'s> {
&self.job.on_success
}

pub fn is_success(&self, report: &Report) -> bool {
pub fn is_success(
&self,
report: &Report,
) -> bool {
report.is_success(self.job.allow_warnings, self.job.allow_failures)
}

Expand Down
6 changes: 2 additions & 4 deletions src/report.rs
Expand Up @@ -31,11 +31,9 @@ impl Report {
allow_warnings: bool,
allow_failures: bool,
) -> bool {
!(
self.stats.errors != 0
!(self.stats.errors != 0
|| (!allow_failures && self.stats.test_fails != 0)
|| (!allow_warnings && self.stats.warnings != 0)
)
|| (!allow_warnings && self.stats.warnings != 0))
}
/// compute the report from the lines of stdout and/or stderr of the
/// `cargo` command.
Expand Down
22 changes: 21 additions & 1 deletion src/settings.rs
Expand Up @@ -12,7 +12,7 @@ use {
/// directory) and by the launch arguments.
///
/// They're immutable during the execution of the missions.
#[derive(Debug, Clone, Default)]
#[derive(Debug, Clone)]
pub struct Settings {
pub arg_job: Option<ConcreteJobRef>,
pub additional_job_args: Vec<String>,
Expand All @@ -29,6 +29,26 @@ pub struct Settings {
pub default_job: ConcreteJobRef,
}

impl Default for Settings {
fn default() -> Self {
Self {
arg_job: Default::default(),
additional_job_args: Default::default(),
additional_alias_args: Default::default(),
summary: false,
wrap: true,
reverse: false,
no_default_features: Default::default(),
all_features: Default::default(),
features: Default::default(),
keybindings: Default::default(),
export_locations: Default::default(),
jobs: Default::default(),
default_job: Default::default(),
}
}
}

impl Settings {
pub fn apply_config(
&mut self,
Expand Down

0 comments on commit 35e15b0

Please sign in to comment.