Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or https://opensource.org/license/mit/.5use std::io::ErrorKind;6use std::process::{Command, Stdio};8use crate::util::{check_output, get_subtrees, git, LintResult};10pub fn lint_doc_release_note_snippets() -> LintResult {11let non_release_notes = check_output(git().args([12"ls-files",13"--",14"doc/release-notes/",15":(exclude)doc/release-notes/*.*.md", // Assume that at least one dot implies a proper release note16]))?;17if non_release_notes.is_empty() {18Ok(())19} else {20println!("{non_release_notes}");21Err(r#"22Release note snippets and other docs must be put into the doc/ folder directly.24The doc/release-notes/ folder is for archived release notes of previous releases only. Snippets are25expected to follow the naming "/doc/release-notes-<PR number>.md".26"#27.trim()28.to_string())29}30}32pub fn lint_doc_args() -> LintResult {33if Command::new("test/lint/check-doc.py")34.status()35.expect("command error")36.success()37{38Ok(())39} else {40Err("".to_string())41}42}44pub fn lint_markdown() -> LintResult {45let bin_name = "mlc";46let mut md_ignore_paths = get_subtrees();47md_ignore_paths.push("./doc/README_doxygen.md");48let md_ignore_path_str = md_ignore_paths.join(",");50let mut cmd = Command::new(bin_name);51cmd.args([52"--offline",53"--ignore-path",54md_ignore_path_str.as_str(),55"--gitignore",56"--gituntracked",57"--root-dir",58".",59])60.stdout(Stdio::null()); // Suppress overly-verbose output62match cmd.output() {63Ok(output) if output.status.success() => Ok(()),64Ok(output) => {65let stderr = String::from_utf8_lossy(&output.stderr);66Err(format!(67r#"68One or more markdown links are broken.70Note: relative links are preferred as jump-to-file works natively within Emacs, but they are not required.72Markdown link errors found:73{stderr}74"#75)76.trim()77.to_string())78}79Err(e) if e.kind() == ErrorKind::NotFound => {80println!("`mlc` was not found in $PATH, skipping markdown lint check.");81Ok(())82}83Err(e) => Err(format!("Error running mlc: {e}")), // Misc errors84}85}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.