Skip to content

Commit efba07d

Browse files
authored
Add license text across all source files (#12)
* feat: add hawkeye for automatic license insertion * chore: run hawkeye on repo to add license everywhere * feat: add hawkeye license check workflow * fix: remove unused bits of licenserc.toml and ignore .github dir
1 parent 5bf565a commit efba07d

11 files changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: License Check
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
- ready_for_review
13+
jobs:
14+
license-check:
15+
name: License Check
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Install Hawkeye
23+
run: |
24+
export VERSION=v6.3.0
25+
curl --proto '=https' --tlsv1.2 -LsSf \
26+
https://github.com/korandoru/hawkeye/releases/download/$VERSION/hawkeye-installer.sh | sh
27+
- name: Check License Headers
28+
run: hawkeye check

LICENSE.txt

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

licenserc.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
headerPath = "LICENSE.txt"
2+
excludes = [
3+
"templates",
4+
"*.toml",
5+
".github",
6+
# Generated files
7+
"output",
8+
]

src/bindings/filters.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
use askama::Result;
26
use heck::{ToLowerCamelCase, ToPascalCase, ToUpperCamelCase};
37
use uniffi_bindgen::interface::{AsType, FfiType, Type};

src/bindings/generator.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
use std::borrow::Borrow;
26
use uniffi_bindgen::{ComponentInterface, interface::{AsType, FfiDefinition, FfiType, Type, Callable}};
37
use anyhow::{Context, Result};

src/bindings/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
use heck::ToKebabCase;
26
use uniffi_bindgen::{BindingGenerator, GenerationSettings};
37
use anyhow::Result;

src/bindings/utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
#[derive(Debug, PartialEq, Eq, Clone)]
26
pub enum DirnameApi {
37
Dirname,

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
use anyhow::{Context, Result};
26
use camino::Utf8PathBuf;
37
use clap::Parser;

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
use anyhow::Result;
26
use clap::Parser;
37
use uniffi_bindgen_node::{Args, run};

src/utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4+
15
use std::{fs, io};
26
use camino::Utf8Path;
37

0 commit comments

Comments
 (0)