Skip to content

Commit

Permalink
Remove the legacy validation functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Suchánek committed Jul 26, 2023
1 parent 08db76c commit d399542
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 853 deletions.
22 changes: 0 additions & 22 deletions docs/using-newdoc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -252,28 +252,6 @@ When generating a new file, `newdoc` warns you if a file by that name already ex
* Preserve the existing file and cancel the newly generated file.


== (Deprecated) Validating a file for Red Hat requirements

You can use the `--validate` (`-l`) option to check an existing file for Red Hat publishing requirements. For example:

----
$ newdoc --validate modules/empty-file.adoc
💾 File: empty-file.adoc
🔴 Error: The file has no title or headings.
🔴 Error: The file is missing an ID.
🔶 Warning: The file is missing the _abstract flag. The flag is recommended but not required.
🔴 Error: Cannot determine the module type.
----

----
$ newdoc --validate modules/con_proper-module.adoc
💾 File: modules/con_proper-module.adoc
🔷 Information: No issues found in this file.
----


== Options

* To generate the file with explanatory comments, add the `--comments` or `-M` option when creating documents.
Expand Down
6 changes: 4 additions & 2 deletions src/cmd_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ pub struct Action {
#[bpaf(short, long, argument("TITLE"))]
pub include_in: Option<String>,

/// DEPRECATED: Validate (lint) an existing module or assembly file
#[bpaf(short('l'), long, argument("FILE"))]
/// REMOVED: Validate (lint) an existing module or assembly file
/// The option is hidden, has no effect, and exists only for compatibility
/// with previous releases.
#[bpaf(short('l'), long, argument("FILE"), hide)]
pub validate: Vec<PathBuf>,
}

Expand Down
12 changes: 3 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::path::PathBuf;

use color_eyre::eyre::{bail, eyre, Result, WrapErr};
use color_eyre::eyre::{bail, Result};

pub mod cmd_line;
mod logging;
mod module;
mod templating;
mod validation;
mod write;

use cmd_line::{Cli, Verbosity};
Expand Down Expand Up @@ -104,8 +103,8 @@ pub fn run(options: &Options, cli: &Cli) -> Result<()> {

// Report any deprecated options.
if !cli.action.validate.is_empty() {
log::warn!("The validation feature is deprecated and will be removed in a later version.\n\
Please switch to the `enki` validation tool: <https://github.com/Levi-Leah/enki/>.");
log::warn!("The validation feature has been removed. \
Please switch to the Enki validation tool: <https://github.com/Levi-Leah/enki/>.");
}
if cli.common_options.no_comments {
log::warn!(
Expand Down Expand Up @@ -165,11 +164,6 @@ pub fn run(options: &Options, cli: &Cli) -> Result<()> {
populated.write_file(options)?;
}

// Validate all file names specified on the command line
for file in &cli.action.validate {
validation::validate(file).wrap_err_with(|| eyre!("Failed to validate file {:?}", file))?;
}

Ok(())
}

Expand Down
Loading

0 comments on commit d399542

Please sign in to comment.