mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge 172cd92620 into merged_master (Bitcoin PR bitcoin/bitcoin#28862)
This commit is contained in:
commit
4267dae9b7
3 changed files with 60 additions and 13 deletions
|
|
@ -23,17 +23,7 @@ else
|
|||
fi
|
||||
export COMMIT_RANGE
|
||||
|
||||
# This only checks that the trees are pure subtrees, it is not doing a full
|
||||
# check with -r to not have to fetch all the remotes.
|
||||
test/lint/git-subtree-check.sh src/crypto/ctaes
|
||||
test/lint/git-subtree-check.sh src/secp256k1
|
||||
test/lint/git-subtree-check.sh src/simplicity
|
||||
test/lint/git-subtree-check.sh src/minisketch
|
||||
test/lint/git-subtree-check.sh src/leveldb
|
||||
test/lint/git-subtree-check.sh src/crc32c
|
||||
RUST_BACKTRACE=1 "${LINT_RUNNER_PATH}/test_runner"
|
||||
test/lint/check-doc.py
|
||||
test/lint/all-lint.py
|
||||
|
||||
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then
|
||||
# Sanity check only the last few commits to get notified of missing sigs,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ ENV LC_ALL=C.UTF-8
|
|||
COPY ./.python-version /.python-version
|
||||
COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh
|
||||
COPY ./ci/lint/04_install.sh /install.sh
|
||||
COPY ./test/lint/test_runner /test/lint/test_runner
|
||||
|
||||
RUN /install.sh && \
|
||||
echo 'alias lint="./ci/lint/06_script.sh"' >> ~/.bashrc && \
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ use std::path::PathBuf;
|
|||
use std::process::Command;
|
||||
use std::process::ExitCode;
|
||||
|
||||
use String as LintError;
|
||||
type LintError = String;
|
||||
type LintResult = Result<(), LintError>;
|
||||
type LintFn = fn() -> LintResult;
|
||||
|
||||
/// Return the git command
|
||||
fn git() -> Command {
|
||||
|
|
@ -31,7 +33,32 @@ fn get_git_root() -> String {
|
|||
check_output(git().args(["rev-parse", "--show-toplevel"])).unwrap()
|
||||
}
|
||||
|
||||
fn lint_std_filesystem() -> Result<(), LintError> {
|
||||
fn lint_subtree() -> LintResult {
|
||||
// This only checks that the trees are pure subtrees, it is not doing a full
|
||||
// check with -r to not have to fetch all the remotes.
|
||||
let mut good = true;
|
||||
for subtree in [
|
||||
"src/crypto/ctaes",
|
||||
"src/secp256k1",
|
||||
"src/minisketch",
|
||||
"src/leveldb",
|
||||
"src/crc32c",
|
||||
"src/simplicity", // ELEMENTS
|
||||
] {
|
||||
good &= Command::new("test/lint/git-subtree-check.sh")
|
||||
.arg(subtree)
|
||||
.status()
|
||||
.expect("command_error")
|
||||
.success();
|
||||
}
|
||||
if good {
|
||||
Ok(())
|
||||
} else {
|
||||
Err("".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
fn lint_std_filesystem() -> LintResult {
|
||||
let found = git()
|
||||
.args([
|
||||
"grep",
|
||||
|
|
@ -55,8 +82,37 @@ fs:: namespace, which has unsafe filesystem functions marked as deleted.
|
|||
}
|
||||
}
|
||||
|
||||
fn lint_doc() -> LintResult {
|
||||
if Command::new("test/lint/check-doc.py")
|
||||
.status()
|
||||
.expect("command error")
|
||||
.success()
|
||||
{
|
||||
Ok(())
|
||||
} else {
|
||||
Err("".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
fn lint_all() -> LintResult {
|
||||
if Command::new("test/lint/all-lint.py")
|
||||
.status()
|
||||
.expect("command error")
|
||||
.success()
|
||||
{
|
||||
Ok(())
|
||||
} else {
|
||||
Err("".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> ExitCode {
|
||||
let test_list = [("std::filesystem check", lint_std_filesystem)];
|
||||
let test_list: Vec<(&str, LintFn)> = vec![
|
||||
("subtree check", lint_subtree),
|
||||
("std::filesystem check", lint_std_filesystem),
|
||||
("-help=1 documentation check", lint_doc),
|
||||
("all-lint.py script", lint_all),
|
||||
];
|
||||
|
||||
let git_root = PathBuf::from(get_git_root());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue