Skip to content

Commit 1f734df

Browse files
authored
Add LICENSE (#19)
1 parent 1127a83 commit 1f734df

21 files changed

+533
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,23 @@ jobs:
8585
cache-on-failure: true
8686
- name: Tests
8787
run: |
88-
cargo test
88+
cargo test
89+
90+
license:
91+
runs-on: "ubuntu-22.04"
92+
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v3
96+
97+
- name: Install ENV
98+
run: |
99+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
100+
brew install nushell
101+
102+
- name: Check License Headers
103+
run: |
104+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
105+
./license_header.nu
106+
git diff
107+
test $(git diff | wc -l) -eq 0

LICENSE

Lines changed: 373 additions & 0 deletions
Large diffs are not rendered by default.

derive/src/attribute_ops.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
use darling::{ast::Data, util, FromAttributes, FromDeriveInput, FromField, FromMeta};
28
use proc_macro2::{Span, TokenStream};
39
use quote::quote;

derive/src/impl_attribute.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
use proc_macro2::TokenStream;
28
use quote::{quote, quote_spanned, ToTokens};
39
use syn::{parse_macro_input, spanned::Spanned, FnArg, ImplItem, ItemImpl, ReturnType, Type};

derive/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
mod attribute_ops;
28
mod impl_attribute;
39
mod type_paths;

derive/src/type_paths.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
use proc_macro2::TokenStream;
28
use quote::quote;
39

license_header.nu

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env nu
2+
3+
let source_root = $env.FILE_PWD
4+
5+
let license_notice = "/*
6+
* This Source Code Form is subject to the terms of the Mozilla Public
7+
* License, v. 2.0. If a copy of the MPL was not distributed with this
8+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
*/
10+
" | lines
11+
12+
let license_length = $license_notice | length
13+
14+
def read_file [path: string]: nothing -> list<string> {
15+
open --raw $path | lines
16+
}
17+
18+
def lines []: string -> list<string> {
19+
split row "\n"
20+
}
21+
22+
def main []: nothing -> nothing {
23+
for file in (ls $"($source_root)/**/*.rs") {
24+
let current_header = read_file $file.name | first $license_length
25+
26+
if $current_header == $license_notice {
27+
continue
28+
}
29+
30+
read_file $file.name | prepend $license_notice | str join "\n" | save -f $file.name
31+
}
32+
}

rust-script/src/apply.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
pub trait Apply: Sized {
28
fn apply<F: FnOnce(&mut Self)>(mut self, cb: F) -> Self {
39
cb(&mut self);

rust-script/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
mod apply;
28
mod script_registry;
39
mod shared;

rust-script/src/library.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
17
use std::collections::BTreeMap;
28

39
use abi_stable::{

0 commit comments

Comments
 (0)