Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fail docs on warnings #5923

Merged
merged 34 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4261659
change (ci): docs job optimized; runs every commit; fails on warnings
TriplEight May 6, 2020
d5d0df9
change (ci): rename jobs; temporary allow failing
TriplEight May 6, 2020
e3dc50f
change (ci): better warnings filtering
TriplEight May 6, 2020
4ac187c
Merge branch 'master' into docs_deny_warnings
TriplEight May 8, 2020
237d83f
fix (ci): hotfix Docker release
TriplEight May 11, 2020
5682836
Merge branch 'master' of github.com:paritytech/substrate
TriplEight May 11, 2020
38fa585
Merge branch 'master' of github.com:paritytech/substrate
TriplEight May 15, 2020
af4ee4b
Merge branch 'master' of github.com:paritytech/substrate
TriplEight May 15, 2020
bec6eba
Merge branch 'master' of github.com:paritytech/substrate
TriplEight May 16, 2020
9247a3f
Merge branch 'master' of github.com:paritytech/substrate
TriplEight May 27, 2020
b9d7f01
Merge branch 'master' of github.com:paritytech/substrate
TriplEight May 27, 2020
d0ab2b4
Merge branch 'master' of github.com:paritytech/substrate
TriplEight Jun 2, 2020
362dfd8
Merge branch 'master' into docs_deny_warnings
TriplEight Jun 2, 2020
762b10a
test (ci): run docs job with flags
TriplEight Jun 2, 2020
0a9ffe9
test (ci): pwd fails
TriplEight Jun 2, 2020
43b024a
change (ci): pass just //doc dir as an artifact; debug
TriplEight Jun 2, 2020
427fe2e
change (ci): return to the previous structure; undebug
TriplEight Jun 2, 2020
72cdab2
Merge branch 'master' of github.com:paritytech/substrate
TriplEight Jun 2, 2020
0389d95
Merge branch 'master' into docs_deny_warnings
TriplEight Jun 2, 2020
450961c
change (ci): typo
TriplEight Jun 2, 2020
fd7352b
Merge branch 'master' into docs_deny_warnings
TriplEight Jun 10, 2020
08d4686
rebase on upstream
TriplEight Sep 9, 2020
4fd1949
rebase on upstream 2
TriplEight Sep 9, 2020
a559a34
fix the jobname
TriplEight Sep 9, 2020
b7be4f1
Fix some warnings (#7079)
danforbes Sep 10, 2020
93c92bf
Merge branch 'master' into docs_deny_warnings
bkchr Sep 10, 2020
feb1f47
Fix more doc errors
bkchr Sep 10, 2020
84d41a5
More doc fixes
bkchr Sep 11, 2020
def5e3a
Remove subdb to make `rustdoc` happy
bkchr Sep 11, 2020
bf5adbf
Make the line length check happy
bkchr Sep 11, 2020
e32d619
Fix compilation error
bkchr Sep 11, 2020
9bfb811
Another try
bkchr Sep 11, 2020
135e579
Allow unused
bkchr Sep 11, 2020
120c22b
Merge remote-tracking branch 'origin/master' into docs_deny_warnings
bkchr Sep 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# image: paritytech/tools:latest # Any docker image (required)
# allow_failure: true # Allow the pipeline to continue if this job fails (default: false)
# dependencies:
# - build-rust-doc-release # Any jobs that are required to run before this job (optional)
# - build-rust-doc # Any jobs that are required to run before this job (optional)
# variables:
# MY_ENVIRONMENT_VARIABLE: "some useful value" # Environment variables passed to the job (optional)
# script:
Expand Down Expand Up @@ -476,23 +476,25 @@ build-macos-subkey:
tags:
- osx

build-rust-doc-release:
build-rust-doc:
stage: build
<<: *docker-env
<<: *docker-env-only
allow_failure: true
variables:
<<: *default-vars
RUSTFLAGS: -Dwarnings
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 7 days
paths:
- ./crate-docs
<<: *build-only
- ./crate-docs/
script:
- rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds
- BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html"
time cargo +nightly doc --release --all --verbose
- cp -R ./target/doc ./crate-docs
- BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html"
time cargo +nightly doc --no-deps --workspace --all-features --verbose
- mv ./target/doc ./crate-docs
- echo "<meta http-equiv=refresh content=0;url=sc_service/index.html>" > ./crate-docs/index.html
- sccache -s

Expand Down Expand Up @@ -670,7 +672,7 @@ publish-s3-doc:
image: paritytech/awscli:latest
allow_failure: true
needs:
- job: build-rust-doc-release
- job: build-rust-doc
artifacts: true
<<: *build-only
<<: *kubernetes-build
Expand Down
2 changes: 0 additions & 2 deletions client/cli/src/arg_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ arg_enum! {
pub enum Database {
// Facebooks RocksDB
RocksDb,
// Subdb. https://github.com/paritytech/subdb/
SubDb,
// ParityDb. https://github.com/paritytech/parity-db/
ParityDb,
}
Expand Down
3 changes: 0 additions & 3 deletions client/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
path: base_path.join("db"),
cache_size,
},
Database::SubDb => DatabaseConfig::SubDb {
path: base_path.join("subdb"),
},
Database::ParityDb => DatabaseConfig::ParityDb {
path: base_path.join("paritydb"),
},
Expand Down
1 change: 0 additions & 1 deletion client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ default = []
test-helpers = []
with-kvdb-rocksdb = ["kvdb-rocksdb"]
with-parity-db = ["parity-db"]
with-subdb = []
10 changes: 0 additions & 10 deletions client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ mod utils;
mod stats;
#[cfg(feature = "with-parity-db")]
mod parity_db;
#[cfg(feature = "with-subdb")]
mod subdb;

use std::sync::Arc;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -287,12 +285,6 @@ pub enum DatabaseSettingsSrc {
path: PathBuf,
},

/// Load a Subdb database from a given path.
SubDb {
/// Path to the database.
path: PathBuf,
},

/// Use a custom already-open database.
Custom(Arc<dyn Database<DbHash>>),
}
Expand All @@ -303,7 +295,6 @@ impl DatabaseSettingsSrc {
match self {
DatabaseSettingsSrc::RocksDb { path, .. } => Some(path.as_path()),
DatabaseSettingsSrc::ParityDb { path, .. } => Some(path.as_path()),
DatabaseSettingsSrc::SubDb { path, .. } => Some(path.as_path()),
DatabaseSettingsSrc::Custom(_) => None,
}
}
Expand All @@ -321,7 +312,6 @@ impl std::fmt::Display for DatabaseSettingsSrc {
let name = match self {
DatabaseSettingsSrc::RocksDb { .. } => "RocksDb",
DatabaseSettingsSrc::ParityDb { .. } => "ParityDb",
DatabaseSettingsSrc::SubDb { .. } => "SubDb",
DatabaseSettingsSrc::Custom(_) => "Custom",
};
write!(f, "{}", name)
Expand Down
88 changes: 0 additions & 88 deletions client/db/src/subdb.rs

This file was deleted.

20 changes: 6 additions & 14 deletions client/db/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,12 @@ pub fn open_database<Block: BlockT>(
config: &DatabaseSettings,
db_type: DatabaseType,
) -> sp_blockchain::Result<Arc<dyn Database<DbHash>>> {
let db_open_error = |feat| Err(
#[allow(unused)]
fn db_open_error(feat: &'static str) -> sp_blockchain::Error {
sp_blockchain::Error::Backend(
format!("`{}` feature not enabled, database can not be opened", feat),
),
);
)
}

let db: Arc<dyn Database<DbHash>> = match &config.source {
#[cfg(any(feature = "with-kvdb-rocksdb", test))]
Expand Down Expand Up @@ -257,16 +258,7 @@ pub fn open_database<Block: BlockT>(
},
#[cfg(not(any(feature = "with-kvdb-rocksdb", test)))]
DatabaseSettingsSrc::RocksDb { .. } => {
return db_open_error("with-kvdb-rocksdb");
},
#[cfg(feature = "with-subdb")]
DatabaseSettingsSrc::SubDb { path } => {
crate::subdb::open(&path, NUM_COLUMNS)
.map_err(|e| sp_blockchain::Error::Backend(format!("{:?}", e)))?
},
#[cfg(not(feature = "with-subdb"))]
DatabaseSettingsSrc::SubDb { .. } => {
return db_open_error("with-subdb");
return Err(db_open_error("with-kvdb-rocksdb"));
},
#[cfg(feature = "with-parity-db")]
DatabaseSettingsSrc::ParityDb { path } => {
Expand All @@ -275,7 +267,7 @@ pub fn open_database<Block: BlockT>(
},
#[cfg(not(feature = "with-parity-db"))]
DatabaseSettingsSrc::ParityDb { .. } => {
return db_open_error("with-parity-db");
return Err(db_open_error("with-parity-db"))
},
DatabaseSettingsSrc::Custom(db) => db.clone(),
};
Expand Down
5 changes: 4 additions & 1 deletion client/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ pub mod network_state;
#[doc(inline)]
pub use libp2p::{multiaddr, Multiaddr, PeerId};
pub use protocol::{event::{DhtEvent, Event, ObservedRole}, sync::SyncState, PeerInfo};
pub use service::{NetworkService, NetworkWorker, RequestFailure, OutboundFailure};
pub use service::{
NetworkService, NetworkWorker, RequestFailure, OutboundFailure, NotificationSender,
NotificationSenderReady,
};

pub use sc_peerset::ReputationChange;
use sp_runtime::traits::{Block as BlockT, NumberFor};
Expand Down
6 changes: 3 additions & 3 deletions client/network/src/request_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Collection of request-response protocols.
//!
//! The [`RequestResponses`] struct defined in this module provides support for zero or more
//! The [`RequestResponse`] struct defined in this module provides support for zero or more
//! so-called "request-response" protocols.
//!
//! A request-response protocol works in the following way:
Expand All @@ -29,7 +29,7 @@
//! - Requests have a certain time limit before they time out. This time includes the time it
//! takes to send/receive the request and response.
//!
//! - If provided, a ["requests processing"](RequestResponseConfig::inbound_queue) channel
//! - If provided, a ["requests processing"](ProtocolConfig::inbound_queue) channel
//! is used to handle incoming requests.
//!

Expand Down Expand Up @@ -108,7 +108,7 @@ pub struct IncomingRequest {
pub peer: PeerId,

/// Request sent by the remote. Will always be smaller than
/// [`RequestResponseConfig::max_request_size`].
/// [`ProtocolConfig::max_request_size`].
pub payload: Vec<u8>,

/// Channel to send back the response to.
Expand Down
14 changes: 7 additions & 7 deletions client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkService<B, H> {
/// > preventing the message from being delivered.
///
/// The protocol must have been registered with `register_notifications_protocol` or
/// `NetworkConfiguration::notifications_protocols`.
/// [`NetworkConfiguration::notifications_protocols`](crate::config::NetworkConfiguration::notifications_protocols).
///
pub fn write_notification(&self, target: PeerId, engine_id: ConsensusEngineId, message: Vec<u8>) {
// We clone the `NotificationsSink` in order to be able to unlock the network-wide
Expand Down Expand Up @@ -682,10 +682,9 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkService<B, H> {
/// 2. [`NotificationSenderReady::send`] enqueues the notification for sending. This operation
/// can only fail if the underlying notification substream or connection has suddenly closed.
///
/// An error is returned either by `notification_sender`, by [`NotificationSender::wait`],
/// or by [`NotificationSenderReady::send`] if there exists no open notifications substream
/// with that combination of peer and protocol, or if the remote has asked to close the
/// notifications substream. If that happens, it is guaranteed that an
/// An error is returned by [`NotificationSenderReady::send`] if there exists no open
/// notifications substream with that combination of peer and protocol, or if the remote
/// has asked to close the notifications substream. If that happens, it is guaranteed that an
/// [`Event::NotificationStreamClosed`] has been generated on the stream returned by
/// [`NetworkService::event_stream`].
///
Expand All @@ -696,7 +695,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkService<B, H> {
/// in which case enqueued notifications will be lost.
///
/// The protocol must have been registered with `register_notifications_protocol` or
/// `NetworkConfiguration::notifications_protocols`.
/// [`NetworkConfiguration::notifications_protocols`](crate::config::NetworkConfiguration::notifications_protocols).
///
/// # Usage
///
Expand Down Expand Up @@ -801,7 +800,8 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkService<B, H> {
/// Such restrictions, if desired, need to be enforced at the call site(s).
///
/// The protocol must have been registered through
/// [`NetworkConfiguration::request_response_protocols`].
/// [`NetworkConfiguration::request_response_protocols`](
/// crate::config::NetworkConfiguration::request_response_protocols).
pub async fn request(
&self,
target: PeerId,
Expand Down
6 changes: 3 additions & 3 deletions frame/assets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ decl_event! {
<T as Trait>::Balance,
<T as Trait>::AssetId,
{
/// Some assets were issued. [asset_id, owner, total_supply]
/// Some assets were issued. \[asset_id, owner, total_supply\]
Issued(AssetId, AccountId, Balance),
/// Some assets were transferred. [asset_id, from, to, amount]
/// Some assets were transferred. \[asset_id, from, to, amount\]
Transferred(AssetId, AccountId, AccountId, Balance),
/// Some assets were destroyed. [asset_id, owner, balance]
/// Some assets were destroyed. \[asset_id, owner, balance\]
Destroyed(AssetId, AccountId, Balance),
}
}
Expand Down
6 changes: 3 additions & 3 deletions frame/atomic-swap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ decl_event!(
AccountId = <T as system::Trait>::AccountId,
PendingSwap = PendingSwap<T>,
{
/// Swap created. [account, proof, swap]
/// Swap created. \[account, proof, swap\]
NewSwap(AccountId, HashedProof, PendingSwap),
/// Swap claimed. The last parameter indicates whether the execution succeeds.
/// [account, proof, success]
/// \[account, proof, success\]
SwapClaimed(AccountId, HashedProof, bool),
/// Swap cancelled. [account, proof]
/// Swap cancelled. \[account, proof\]
SwapCancelled(AccountId, HashedProof),
}
);
Expand Down
16 changes: 8 additions & 8 deletions frame/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,24 +235,24 @@ decl_event!(
<T as frame_system::Trait>::AccountId,
<T as Trait<I>>::Balance
{
/// An account was created with some free balance. [account, free_balance]
/// An account was created with some free balance. \[account, free_balance\]
Endowed(AccountId, Balance),
/// An account was removed whose balance was non-zero but below ExistentialDeposit,
/// resulting in an outright loss. [account, balance]
/// resulting in an outright loss. \[account, balance\]
DustLost(AccountId, Balance),
/// Transfer succeeded. [from, to, value]
/// Transfer succeeded. \[from, to, value\]
Transfer(AccountId, AccountId, Balance),
/// A balance was set by root. [who, free, reserved]
/// A balance was set by root. \[who, free, reserved\]
BalanceSet(AccountId, Balance, Balance),
/// Some amount was deposited (e.g. for transaction fees). [who, deposit]
/// Some amount was deposited (e.g. for transaction fees). \[who, deposit\]
Deposit(AccountId, Balance),
/// Some balance was reserved (moved from free to reserved). [who, value]
/// Some balance was reserved (moved from free to reserved). \[who, value\]
Reserved(AccountId, Balance),
/// Some balance was unreserved (moved from reserved to free). [who, value]
/// Some balance was unreserved (moved from reserved to free). \[who, value\]
Unreserved(AccountId, Balance),
/// Some balance was moved from the reserve of the first account to the second account.
/// Final argument indicates the destination balance type.
/// [from, to, balance, destination_status]
/// \[from, to, balance, destination_status\]
ReserveRepatriated(AccountId, AccountId, Balance, Status),
}
);
Expand Down
Loading