Skip to content

Commit

Permalink
Merge pull request #128 from xStrom/copyhead
Browse files Browse the repository at this point in the history
Standardize copyright headers.
  • Loading branch information
xStrom authored May 21, 2024
2 parents 4427a99 + 14b9e6f commit c77e67a
Show file tree
Hide file tree
Showing 92 changed files with 257 additions and 498 deletions.
23 changes: 23 additions & 0 deletions .github/copyright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# If there are new files with headers that can't match the conditions here,
# then the files can be ignored by an additional glob argument via the -g flag.
# For example:
# -g "!src/special_file.rs"
# -g "!src/special_directory"

# Check all the standard Rust source files
output=$(rg "^// Copyright (19|20)[\d]{2} (.+ and )?the Druid Authors( and .+)?$\n^// SPDX-License-Identifier: Apache-2\.0 OR MIT$\n\n" --files-without-match --multiline -g "*.rs" .)

if [ -n "$output" ]; then
echo -e "The following files lack the correct copyright header:\n"
echo $output
echo -e "\n\nPlease add the following header:\n"
echo "// Copyright $(date +%Y) the Druid Authors"
echo "// SPDX-License-Identifier: Apache-2.0 OR MIT"
echo -e "\n... rest of the file ...\n"
exit 1
fi

echo "All files have correct copyright headers."
exit 0
5 changes: 4 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install libgtk-3-dev
sudo apt-get install libgtk-3-dev ripgrep
- name: Check copyright headers
run: bash .github/copyright.sh

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Extra widgets for `druid` that are not yet ready for inclusion in
version = "0.1.0"
authors = ["Richard Dodd <richard.o.dodd@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
license = "Apache-2.0 OR MIT"

[features]
async = ["tokio/rt", "futures", "flume"]
Expand Down
2 changes: 1 addition & 1 deletion druid-widget-nursery-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "druid-widget-nursery-derive"
description = "A proc-macro helper library for `druid-widget-nursery`"
version = "0.1.0"
edition = "2021"
license = "MIT/Apache-2.0"
license = "Apache-2.0 OR MIT"

[lib]
proc-macro = true
Expand Down
3 changes: 3 additions & 0 deletions druid-widget-nursery-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro::TokenStream;
use syn::{parse_macro_input, DeriveInput};

Expand Down
3 changes: 3 additions & 0 deletions druid-widget-nursery-derive/src/prism.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use syn::{parse_quote, spanned::Spanned, Data, DeriveInput, Fields, GenericParam, WherePredicate};
Expand Down
3 changes: 3 additions & 0 deletions examples/advanced_slider_demo.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Flex, Slider};
use druid::{AppLauncher, Color, Widget, WidgetExt, WindowDesc};
use druid_widget_nursery::AdvancedSlider;
Expand Down
3 changes: 3 additions & 0 deletions examples/animated_value.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::{
AppLauncher, BoxConstraints, Color, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx,
PaintCtx, RenderContext, Size, UnitPoint, UpdateCtx, Widget, WidgetExt, WindowDesc,
Expand Down
17 changes: 2 additions & 15 deletions examples/animation-curves.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Dietmar Maurer <dietmar@proxmox.com>
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::kurbo::{BezPath, Circle, Line};
use druid::piet::{LineCap, LineJoin, RenderContext, StrokeStyle};
Expand Down
3 changes: 3 additions & 0 deletions examples/animator.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::kurbo::{Circle, Point, Size};
use druid::widget::{
Button, CrossAxisAlignment, Flex, Label, LabelText, RadioGroup, TextBox, WidgetExt,
Expand Down
15 changes: 2 additions & 13 deletions examples/async.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2019 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2019 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::time::Duration;

Expand Down
3 changes: 3 additions & 0 deletions examples/canvas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::lens::Map;
use druid::widget::{Button, Flex, Label, LabelText, Split, TextBox};
use druid::{AppLauncher, Data, Env, Lens, Point, Size, Widget, WidgetExt, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions examples/dropdown.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{
Button, CrossAxisAlignment, Flex, Label, RadioGroup, Scroll, TextBox, WidgetExt,
};
Expand Down
3 changes: 3 additions & 0 deletions examples/dynamic_sized_box.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::{
widget::{Flex, Label, LineBreaking, MainAxisAlignment, SizedBox},
AppLauncher, Color, Data, Env, Lens, Widget, WidgetExt, WindowDesc,
Expand Down
15 changes: 2 additions & 13 deletions examples/file_manager.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2019 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2019 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Demos advanced tree widget and tree manipulations.

Expand Down
17 changes: 2 additions & 15 deletions examples/flex-table.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
// Copyright 2021 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Dietmar Maurer <dietmar@proxmox.com>
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{
Align, Container, CrossAxisAlignment, Flex, Label, Stepper, TextBox, WidgetExt,
Expand Down
3 changes: 3 additions & 0 deletions examples/hot-reload/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Flex, TextBox};
use druid::{Data, Lens, Widget, WidgetExt};

Expand Down
3 changes: 3 additions & 0 deletions examples/hot-reload/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid_widget_nursery::hot_reload::{AppLauncher, WindowDesc};
use hot_reload::AppData;

Expand Down
15 changes: 2 additions & 13 deletions examples/json_viewer.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2019 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2019 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! A json viewer using the tree widget
use std::{
Expand Down
15 changes: 2 additions & 13 deletions examples/mask.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Button, Flex, TextBox};
use druid::{AppLauncher, Color, Data, Lens, Widget, WidgetExt, WindowDesc, WindowSizePolicy};
Expand Down
3 changes: 3 additions & 0 deletions examples/material_icons.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::{widget::Flex, AppLauncher, Color, LocalizedString, Widget, WidgetExt, WindowDesc};
use druid_widget_nursery::material_icons::{
normal::action::{ABC, ADD_CARD, ADD_TASK, ADD_TO_DRIVE},
Expand Down
3 changes: 3 additions & 0 deletions examples/navigator.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::sync::Arc;

use druid::{
Expand Down
3 changes: 3 additions & 0 deletions examples/partial.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Flex, Radio, TextBox};
use druid::{AppLauncher, Data, UnitPoint, Widget, WidgetExt, WindowDesc};
use druid_widget_nursery::prism::{Closures, DisablePrismWrap};
Expand Down
3 changes: 3 additions & 0 deletions examples/prisms.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{CrossAxisAlignment, Flex, Slider, TextBox};
use druid::{AppLauncher, Data, UnitPoint, Widget, WidgetExt, WindowDesc};
use druid_widget_nursery::prism::{Closures, Prism};
Expand Down
3 changes: 3 additions & 0 deletions examples/progress_bar.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::piet;
use druid::piet::{Color, GradientStop, UnitPoint};
use druid::widget::{Button, Flex, Label, WidgetExt};
Expand Down
15 changes: 2 additions & 13 deletions examples/select.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2019 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2019 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{CrossAxisAlignment, Flex, Label, Scroll};
use druid::{AppLauncher, Data, Env, Insets, Lens, Widget, WidgetExt, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions examples/splits.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::im::Vector;
use druid::widget::{Container, Flex, Label, Scroll, WidgetExt};
use druid::{AppLauncher, Data, Env, Lens, Widget, WindowDesc};
Expand Down
15 changes: 2 additions & 13 deletions examples/stack-containers.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Container, Label};
use druid::{AppLauncher, Color, Data, Lens, Widget, WidgetExt, WindowDesc};
Expand Down
15 changes: 2 additions & 13 deletions examples/stack-fit.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Container, Label};
use druid::{AppLauncher, Color, Data, Lens, Widget, WidgetExt, WindowDesc};
Expand Down
15 changes: 2 additions & 13 deletions examples/stack-gradient.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Align, Container, Label};
use druid::{
Expand Down
15 changes: 2 additions & 13 deletions examples/stack.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::widget::{Container, Controller, Flex, Label, Slider, TextBox};
use druid::{
Expand Down
15 changes: 2 additions & 13 deletions examples/stack_tooltip.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright 2022 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2022 the Druid Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use druid::{
widget::{Flex, Label},
Expand Down
Loading

0 comments on commit c77e67a

Please sign in to comment.