Skip to content

Commit

Permalink
chore: uniformize deny attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Aug 19, 2022
1 parent 5176771 commit f7f136d
Show file tree
Hide file tree
Showing 46 changed files with 73 additions and 66 deletions.
2 changes: 1 addition & 1 deletion git-actor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
use bstr::{BStr, BString};
pub use git_date::{time::Sign, Time};

Expand Down
2 changes: 1 addition & 1 deletion git-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]

use std::path::PathBuf;

Expand Down
4 changes: 2 additions & 2 deletions git-bitmap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(unsafe_code, missing_docs, rust_2018_idioms)]
#![allow(missing_docs)]
//! An implementation of the shared parts of git bitmaps used in `git-pack`, `git-index` and `git-worktree`.
//!
//! Note that many tests are performed indirectly by tests in the aforementioned consumer crates.
#![deny(rust_2018_idioms, unsafe_code)]
#![allow(missing_docs)]

/// Bitmap utilities for the advanced word-aligned hybrid bitmap
pub mod ewah;
Expand Down
3 changes: 1 addition & 2 deletions git-chunk/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Low-level access to reading and writing chunk file based formats.
//!
//! See the [git documentation](https://github.com/git/git/blob/seen/Documentation/technical/chunk-format.txt) for details.
#![deny(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

/// An identifier to describe the kind of chunk, unique within a chunk file, typically in ASCII
pub type Id = [u8; 4];
Expand Down
2 changes: 1 addition & 1 deletion git-commitgraph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code, rust_2018_idioms, missing_docs)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

pub mod file;
pub mod graph;
Expand Down
3 changes: 1 addition & 2 deletions git-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(missing_docs, unsafe_code, rust_2018_idioms)]

//! # `git_config`
//!
//! This crate is a high performance `git-config` file reader and writer. It
Expand Down Expand Up @@ -36,6 +34,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

pub mod file;

Expand Down
2 changes: 1 addition & 1 deletion git-credentials/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![forbid(unsafe_code)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

///
pub mod helper;
Expand Down
2 changes: 1 addition & 1 deletion git-date/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![forbid(unsafe_code)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

///
pub mod time;
Expand Down
4 changes: 2 additions & 2 deletions git-diff/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Algorithms for diffing various git object types and for generating patches, highly optimized for performance.
#![forbid(unsafe_code, rust_2018_idioms)]
#[deny(missing_docs)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

///
pub mod tree;
4 changes: 2 additions & 2 deletions git-discover/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Find git repositories or search them upwards from a starting point, or determine if a directory looks like a git repository.
//!
//! Note that detection methods are educated guesses using the presence of files, without looking too much into the details.
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(missing_docs)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

/// The name of the `.git` directory.
pub const DOT_GIT_DIR: &str = ".git";
Expand Down
3 changes: 1 addition & 2 deletions git-features/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![forbid(rust_2018_idioms)]
#![deny(unsafe_code, missing_docs)]
//! A crate providing foundational capabilities to other `git-*` crates with trade-offs between compile time, binary size or speed
//! selectable using cargo feature toggles.
//!
Expand All @@ -13,6 +11,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

///
pub mod cache;
Expand Down
3 changes: 2 additions & 1 deletion git-filter/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
2 changes: 1 addition & 1 deletion git-glob/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]

use bstr::BString;

Expand Down
7 changes: 3 additions & 4 deletions git-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
//! These are provided in borrowed versions as well as owned ones.
//! ## Feature Flags
#![cfg_attr(
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

mod borrowed;

Expand Down
3 changes: 2 additions & 1 deletion git-lfs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
2 changes: 1 addition & 1 deletion git-lock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//!
//! * As the lock file is separate from the actual resource, locking is merely a convention rather than being enforced.
//! * The limitations of `git-tempfile` apply.
#![deny(missing_docs, unsafe_code, rust_2018_idioms)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

use std::path::PathBuf;

Expand Down
9 changes: 7 additions & 2 deletions git-mailmap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
//! [Parse][parse()] .mailmap files as used in git repositories and remap names and emails
//! using an [accelerated data-structure][Snapshot].
//! ## Feature Flags
#![cfg_attr(
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

use bstr::BStr;

Expand Down
3 changes: 2 additions & 1 deletion git-note/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
2 changes: 1 addition & 1 deletion git-object/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]

use std::borrow::Cow;

Expand Down
3 changes: 1 addition & 2 deletions git-odb/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(missing_docs, unsafe_code, rust_2018_idioms)]

//! Git stores all of its data as _Objects_, which are data along with a hash over all data. Thus it's an
//! object store indexed by the signature of data itself with inherent deduplication: the same data will have the same hash,
//! and thus occupy the same space within the store.
Expand All @@ -14,6 +12,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

use std::{
cell::RefCell,
Expand Down
3 changes: 1 addition & 2 deletions git-pack/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(missing_docs, unsafe_code, rust_2018_idioms)]

//! Git stores all of its data as _Objects_, which are data along with a hash over all data. Storing objects efficiently
//! is what git packs are concerned about.
//!
Expand All @@ -17,6 +15,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

///
pub mod bundle;
Expand Down
2 changes: 1 addition & 1 deletion git-packetline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code, rust_2018_idioms, missing_docs)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

const U16_HEX_BYTES: usize = 4;
const MAX_DATA_LEN: usize = 65516;
Expand Down
4 changes: 2 additions & 2 deletions git-path/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(missing_docs)]
//! This crate contains an assortment of utilities to deal with paths and their conversions.
//!
//! Generally `git` treats paths as bytes, but inherently assumes non-illformed UTF-8 as encoding on windows. Internally, it expects
Expand Down Expand Up @@ -48,6 +46,8 @@
//! Callers may `.expect()` on the result to indicate they don't wish to handle this special and rare case. Note that servers should not
//! ever get into a code-path which does panic though.
//! </details>
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

/// A dummy type to represent path specs and help finding all spots that take path specs once it is implemented.
Expand Down
4 changes: 2 additions & 2 deletions git-pathspec/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Parse [path specifications](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec) and
//! see if a path matches.
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(missing_docs)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

use bitflags::bitflags;
use bstr::BString;
Expand Down
3 changes: 1 addition & 2 deletions git-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

pub use git_credentials as credentials;
/// A convenience export allowing users of git-protocol to use the transport layer without their own cargo dependency.
Expand Down
3 changes: 2 additions & 1 deletion git-quote/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]

///
pub mod ansi_c;
3 changes: 2 additions & 1 deletion git-rebase/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
2 changes: 1 addition & 1 deletion git-ref/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code, missing_docs, rust_2018_idioms)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

use std::borrow::Cow;

Expand Down
4 changes: 2 additions & 2 deletions git-refspec/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Parse git ref-specs and represent them.
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(missing_docs)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

///
pub mod parse;
Expand Down
2 changes: 1 addition & 1 deletion git-repository/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, unsafe_code, rust_2018_idioms)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

// Re-exports to make this a potential one-stop shop crate avoiding people from having to reference various crates themselves.
// This also means that their major version changes affect our major version, but that's alright as we directly expose their
Expand Down
2 changes: 1 addition & 1 deletion git-revision/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code, missing_docs, rust_2018_idioms)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

/// Access to collections optimized for keys that are already a hash.
pub use hash_hasher;
Expand Down
3 changes: 2 additions & 1 deletion git-sec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code, rust_2018_idioms, missing_docs)]
// `unsafe_code` not forbidden because we need to interact with the libc
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

use std::{
fmt::{Debug, Display, Formatter},
Expand Down
3 changes: 2 additions & 1 deletion git-sequencer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
3 changes: 2 additions & 1 deletion git-submodule/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
2 changes: 1 addition & 1 deletion git-tempfile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! but not others. Any other operation dealing with the tempfile suffers from the same issue.
//!
//! [signal-hook]: https://docs.rs/signal-hook
#![deny(missing_docs, unsafe_code, rust_2018_idioms)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

use std::{
io,
Expand Down
3 changes: 2 additions & 1 deletion git-tix/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]
2 changes: 1 addition & 1 deletion git-transport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]

pub use git_packetline as packetline;

Expand Down
4 changes: 2 additions & 2 deletions git-traverse/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(missing_docs)]
//! Various ways to traverse commit graphs and trees with implementations as iterator
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

/// Commit traversal
pub mod commit;
Expand Down
2 changes: 1 addition & 1 deletion git-tui/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]

fn main() {
unimplemented!();
Expand Down
6 changes: 3 additions & 3 deletions git-url/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! A library implementing a URL for use in git with access to its special capabilities.
//! ## Feature Flags
#![cfg_attr(
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms)]
#![forbid(unsafe_code)]

use std::{
convert::TryFrom,
Expand Down
2 changes: 1 addition & 1 deletion git-validate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Validation for various kinds of git related items.
#![forbid(unsafe_code)]
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

///
pub mod reference;
Expand Down
3 changes: 1 addition & 2 deletions git-worktree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![deny(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]

/// file system related utilities
pub mod fs;
Expand Down
Loading

0 comments on commit f7f136d

Please sign in to comment.