Skip to content

Commit

Permalink
Merge pull request #27 from KnpLabs/fix/rust-edition-2021
Browse files Browse the repository at this point in the history
Fix/rust edition 2021
  • Loading branch information
nm2107 authored Mar 8, 2022
2 parents 207a7d8 + 7e793b4 commit 706697f
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 116 deletions.
14 changes: 4 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ reference:
# uid 1001 but uid 1000 is used in the containers.
sudo chown -R 1000 .
run_unit_tests_step: &run_unit_tests_step
run_tests_step: &run_tests_step
run:
name: Run unit tests
command: make test-unit

run_functional_tests_step: &run_functional_tests_step
run:
name: Run functional tests
command: make test-functional
name: Run tests
command: make tests

build_release_step: &build_release_step
run:
Expand All @@ -72,8 +67,7 @@ jobs:
- <<: *build_docker_image_step
- <<: *restore_cache_step
- <<: *chown_working_directory_step
- <<: *run_unit_tests_step
- <<: *run_functional_tests_step
- <<: *run_tests_step
- <<: *enlight_cache_step
- <<: *save_cache_step

Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
.cargo/
ci/Cargo.lock
cli/Cargo.lock
git/Cargo.lock
logger/Cargo.lock
utils/Cargo.lock
target/
43 changes: 4 additions & 39 deletions Cargo.lock

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

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ authors = ["KNP Labs"]
readme = "README.md"
license = "MIT"
license-file = "LICENSE"
edition = "2018"
edition = "2021"

[dependencies]
ci = { path = "ci" }
cli = { path = "cli" }
git = { path = "git" }
logger = { path= "logger" }
log = "0.4"
simple_logger = { version = "2.1.0", default-features = false }
structopt = "0.3"

[dev-dependencies]
rand = "0.7"
Expand Down
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ build-release:
docker-compose run --rm app \
cargo build --release

# https://manpages.debian.org/testing/cargo/cargo-test.1.en.html
.PHONY: test-unit
test-unit:
docker-compose run --rm app \
cargo test --tests $(TEST_FLAGS) \
-p ci \
# add the other packages to test with the -p flag

.PHONY: test-functional
test-functional:
.PHONY: tests
tests:
docker-compose run --rm app \
cargo test --tests $(TEST_FLAGS)
8 changes: 0 additions & 8 deletions ci/Cargo.toml

This file was deleted.

8 changes: 0 additions & 8 deletions cli/Cargo.toml

This file was deleted.

9 changes: 0 additions & 9 deletions git/Cargo.toml

This file was deleted.

9 changes: 0 additions & 9 deletions logger/Cargo.toml

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion git/src/branch.rs → src/git/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
use std::process::Command;
use log::debug;

use utils::assert_or_panic;
use crate::utils::assert_or_panic;

pub fn get_current_branch(
working_directory: &PathBuf,
Expand Down
6 changes: 3 additions & 3 deletions git/src/commits_range.rs → src/git/commits_range.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::PathBuf;
use crate::branch::get_current_branch;
use crate::branch::get_current_remote;
use crate::branch::get_merge_base_commit;
use super::branch::get_current_branch;
use super::branch::get_current_remote;
use super::branch::get_merge_base_commit;

pub struct CommitsRange {
from: String,
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions git/src/path_inspector.rs → src/git/path_inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::path::PathBuf;
use std::process::Command;
use log::{debug, info};

use utils::assert_or_panic;
use crate::commits_range::CommitsRange;
use crate::utils::assert_or_panic;
use super::commits_range::CommitsRange;

pub fn has_changes_in_paths(
working_directory: &PathBuf,
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
mod git;
mod ci;
mod utils;

use std::path::PathBuf;
use git::commits_range::CommitsRange;
use git::commits_range::resolve_commits_range;
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
mod lib;
mod cli;
mod logger;

use std::env::current_dir;
use std::process::exit;

use cli::Cli;
use lib::should_skip_ci;
use ssc::should_skip_ci;
use logger::configure_logger;

fn main() {
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions utils/Cargo.toml

This file was deleted.

0 comments on commit 706697f

Please sign in to comment.