Skip to content

Commit d399542

Browse files
author
Marek Suchánek
committed
Remove the legacy validation functionality
1 parent 08db76c commit d399542

File tree

4 files changed

+7
-853
lines changed

4 files changed

+7
-853
lines changed

docs/using-newdoc.adoc

-22
Original file line numberDiff line numberDiff line change
@@ -252,28 +252,6 @@ When generating a new file, `newdoc` warns you if a file by that name already ex
252252
* Preserve the existing file and cancel the newly generated file.
253253

254254

255-
== (Deprecated) Validating a file for Red Hat requirements
256-
257-
You can use the `--validate` (`-l`) option to check an existing file for Red Hat publishing requirements. For example:
258-
259-
----
260-
$ newdoc --validate modules/empty-file.adoc
261-
262-
💾 File: empty-file.adoc
263-
🔴 Error: The file has no title or headings.
264-
🔴 Error: The file is missing an ID.
265-
🔶 Warning: The file is missing the _abstract flag. The flag is recommended but not required.
266-
🔴 Error: Cannot determine the module type.
267-
----
268-
269-
----
270-
$ newdoc --validate modules/con_proper-module.adoc
271-
272-
💾 File: modules/con_proper-module.adoc
273-
🔷 Information: No issues found in this file.
274-
----
275-
276-
277255
== Options
278256

279257
* To generate the file with explanatory comments, add the `--comments` or `-M` option when creating documents.

src/cmd_line.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ pub struct Action {
9898
#[bpaf(short, long, argument("TITLE"))]
9999
pub include_in: Option<String>,
100100

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

src/lib.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
3535
3636
use std::path::PathBuf;
3737

38-
use color_eyre::eyre::{bail, eyre, Result, WrapErr};
38+
use color_eyre::eyre::{bail, Result};
3939

4040
pub mod cmd_line;
4141
mod logging;
4242
mod module;
4343
mod templating;
44-
mod validation;
4544
mod write;
4645

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

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

168-
// Validate all file names specified on the command line
169-
for file in &cli.action.validate {
170-
validation::validate(file).wrap_err_with(|| eyre!("Failed to validate file {:?}", file))?;
171-
}
172-
173167
Ok(())
174168
}
175169

0 commit comments

Comments
 (0)