Skip to content

Commit

Permalink
Check all lines of license header (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
echeran authored Mar 24, 2021
1 parent 43ad4cd commit 7c82cb3
Show file tree
Hide file tree
Showing 164 changed files with 181 additions and 5 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[alias]

### INDIVIDUAL TEST AND LINT TASKS ###
Expand Down
1 change: 1 addition & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

ignore:
- "/*"
- "C:/*"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

name: Build and Test

# TODO(#234) re-include cache steps, also using Rust version in cache key
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

name: Coverage

on:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[workspace]

members = [
Expand Down
21 changes: 18 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[config]
default_to_workspace = false
load_cargo_aliases = true
Expand Down Expand Up @@ -34,18 +35,32 @@ exit_on_error true
glob_pattern_array = array "./**/*.rs" "./**/*.yml" "./**/*.toml"
blank_line = set ""
license_hash_line_1 = set "# This file is part of ICU4X. For terms of use, please see the file"
license_hash_line_2 = set "# called LICENSE at the top level of the ICU4X source tree"
license_hash_line_3 = set "# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE )."
license_hash_array = array ${license_hash_line_1} ${license_hash_line_2} ${license_hash_line_3} ${blank_line}
license_hash_str = array_join ${license_hash_array} "\n"
license_slash_line_1 = set "// This file is part of ICU4X. For terms of use, please see the file"
license_slash_line_2 = set "// called LICENSE at the top level of the ICU4X source tree"
license_slash_line_3 = set "// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE )."
license_slash_array = array ${license_slash_line_1} ${license_slash_line_2} ${license_slash_line_3} ${blank_line}
license_slash_str = array_join ${license_slash_array} "\n"
for pattern in ${glob_pattern_array}
handle = glob_array ${pattern}
for path in ${handle}
if not starts_with ${path} "target" # skip paths in target dir
text = readfile ${path}
result_hash = starts_with ${text} "# This file is part of ICU4X. For terms of use, please see the file"
result_slash = starts_with ${text} "// This file is part of ICU4X. For terms of use, please see the file"
result_hash = starts_with ${text} ${license_hash_str}
result_slash = starts_with ${text} ${license_slash_str}
not_result_hash = not ${result_hash}
not_result_slash = not ${result_slash}
if ${not_result_hash} and ${not_result_slash}
echo "License header missing in ${path}"
trigger_error "License header missing in ${path}"
trigger_error "License header missing or misformatted in ${path}."
end
end
end
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

ignore:
- "/*"
- "C:/*"
Expand Down
1 change: 1 addition & 0 deletions components/datetime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[package]
name = "icu_datetime"
description = "API for formatting date and time to user readable textual representation"
Expand Down
1 change: 1 addition & 0 deletions components/datetime/benches/datetime.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod fixtures;

use criterion::{criterion_group, criterion_main, Criterion};
Expand Down
1 change: 1 addition & 0 deletions components/datetime/benches/fixtures/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

pub mod structs;

use icu_datetime::options::{style, DateTimeFormatOptions};
Expand Down
1 change: 1 addition & 0 deletions components/datetime/benches/fixtures/structs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions components/datetime/benches/pattern.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod fixtures;

use criterion::{criterion_group, criterion_main, Criterion};
Expand Down
1 change: 1 addition & 0 deletions components/datetime/examples/work_log.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

// An example application which uses icu_datetime to format entries
// from a work log into human readable dates and times.

Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use crate::pattern;
use icu_provider::prelude::DataError;

Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/fields/length.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use std::convert::TryFrom;

#[derive(Debug)]
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/fields/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod length;
mod symbols;

Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/fields/symbols.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use std::convert::TryFrom;

#[derive(Debug)]
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/options/components.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! Components is a model of encoding information on how to format date and time by specifying a list of components
//! the user wants to be visible in the formatted string and how each field should be displayed.
//!
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/options/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! `DateTimeFormatOptions` is a bag of options which, together with `LanguageIdentifier`,
//! define how dates will be formatted be a `DateTimeFormat` instance.
//!
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/options/preferences.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! Preferences is a bag of options to be associated with either `Style` or `Components` bag which provides
//! information on user preferences that can affect the result of the formatting.
//!
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/options/style.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! Style is a model of encoding information on how to format date and time by specifying the preferred length
//! of date and time fields.
//!
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/pattern/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use crate::fields;

#[derive(Debug, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/pattern/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod error;
mod parser;

Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/pattern/parser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use super::error::Error;
use super::{Pattern, PatternItem};
use crate::fields::FieldSymbol;
Expand Down
1 change: 1 addition & 0 deletions components/datetime/tests/datetime.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![cfg(all(not(feature = "serialize_none"), feature = "serde"))]

mod fixtures;
Expand Down
1 change: 1 addition & 0 deletions components/datetime/tests/fixtures/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![cfg(all(not(feature = "serialize_none"), feature = "serde"))]

pub mod structs;
Expand Down
1 change: 1 addition & 0 deletions components/datetime/tests/fixtures/structs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![cfg(all(not(feature = "serialize_none"), feature = "serde"))]

use icu_datetime::options::{components, style};
Expand Down
1 change: 1 addition & 0 deletions components/datetime/tests/patterns/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

pub mod structs;

use std::fs::File;
Expand Down
1 change: 1 addition & 0 deletions components/datetime/tests/patterns/structs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions components/ecma402/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[package]
name = "icu4x_ecma402"
description = "ECMA-402 API functionality backed by the ICU4X library"
Expand Down
2 changes: 1 addition & 1 deletion components/ecma402/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE )
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use icu::locid::LanguageIdentifier;

Expand Down
2 changes: 1 addition & 1 deletion components/ecma402/src/pluralrules.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE )
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! Implements the traits found in [`ecma402_traits::pluralrules`].
Expand Down
1 change: 1 addition & 0 deletions components/icu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[package]
name = "icu"
description = "International Components for Unicode"
Expand Down
1 change: 1 addition & 0 deletions components/icu/examples/tui.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

// An example program making use of a number of ICU components
// in a pseudo-real-world application of Textual User Interface.

Expand Down
1 change: 1 addition & 0 deletions components/icu/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! `icu` is the main meta-package of the `ICU4X` project.
//!
//! It provides a comperhensive selection of Unicode Internationalization Components
Expand Down
1 change: 1 addition & 0 deletions components/icu4x/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[package]
name = "icu4x"
description = "International Components for Unicode"
Expand Down
1 change: 1 addition & 0 deletions components/icu4x/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! `icu4x` is an alias to the [`icu`](../icu/index.html) package.
1 change: 1 addition & 0 deletions components/locale_canonicalizer/benches/helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use std::fs::File;
use std::io::{BufReader, Error};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod helpers;

use criterion::{criterion_group, criterion_main, Criterion};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use crate::provider::*;
use icu_locid::LanguageIdentifier;
use icu_provider::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions components/locale_canonicalizer/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use icu_locid::LanguageIdentifier;

pub mod key {
Expand Down
1 change: 1 addition & 0 deletions components/locale_canonicalizer/tests/fixtures/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use serde::Deserialize;

#[derive(Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions components/locale_canonicalizer/tests/helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use std::fs::File;
use std::io::{BufReader, Error};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod fixtures;
mod helpers;

Expand Down
1 change: 1 addition & 0 deletions components/locid/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[package]
name = "icu_locid"
description = "API for managing Unicode Language and Locale Identifiers"
Expand Down
Loading

0 comments on commit 7c82cb3

Please sign in to comment.