Skip to content

Commit

Permalink
chore: updates source file header and adds corresponding documentation (
Browse files Browse the repository at this point in the history
#154)

* chore: removes shebangs from files with no main function

Standardize the inclusion of shebang to be more explicit. They are
only needed on files that will be executed directly.

Signed-off-by: Jennifer Power <[email protected]>

* chore: updates licensing terms in files to SPDX identifier

Using the longer format to specifiy licensing terms contributes
to larger diff and overall makes the core logic less readble.
Switching to SPDX Identifier makes this more concise and easy
to update.

Signed-off-by: Jennifer Power <[email protected]>

* docs: updates CONTRIBUTING.md to include guidance on license text

Signed-off-by: Jennifer Power <[email protected]>

---------

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jan 24, 2024
1 parent 12d9b8e commit 929f84c
Show file tree
Hide file tree
Showing 65 changed files with 179 additions and 932 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Before you start contributing, please take a moment to read through the guide be
- [Code structure](#code-structure)
- [Documentation](#documentation)
- [Update the `actions` files](#update-the-actions-files)
- [License Text in Files](#license-text-in-files)
- [Tools](#tools)
- [Format and Styling](#format-and-styling)
- [Type Hints and Static Type Checking](#type-hints-and-static-type-checking)
Expand Down Expand Up @@ -86,6 +87,14 @@ Each `README.md` under the `actions` directory have an Actions Inputs and Action
make update-action-readmes
```

### License Text in Files

Please use the SPDX license identifier in all source files.

```
# SPDX-License-Identifier: Apache-2.0
```

### Tools

#### Format and Styling
Expand Down
16 changes: 2 additions & 14 deletions scripts/update_action_readmes.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.

# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

"""
Find every action.yml file in the repo and README.md next to it
Expand Down
16 changes: 2 additions & 14 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

# Copyright 2023 Red Hat, Inc.
#
# 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.
"""Test package."""
18 changes: 3 additions & 15 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Common test fixtures."""

Expand Down
16 changes: 2 additions & 14 deletions tests/e2e/test_e2e_compdef.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

# Copyright 2023 Red Hat, Inc.
#
# 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.

"""E2E tests for commands for component definition authoring."""

Expand Down
18 changes: 3 additions & 15 deletions tests/e2e/test_e2e_ssp.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""
E2E tests for SSP creation and autosync workflow.
Expand Down
18 changes: 3 additions & 15 deletions tests/testutils.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Helper functions for unit test setup and teardown."""

Expand Down
16 changes: 2 additions & 14 deletions tests/trestlebot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

# Copyright 2023 Red Hat, Inc.
#
# 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.
"""Test package for trestlebot top-level logic."""
16 changes: 2 additions & 14 deletions tests/trestlebot/entrypoints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

# Copyright 2023 Red Hat, Inc.
#
# 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.
"""Test package for entrypoints."""
18 changes: 3 additions & 15 deletions tests/trestlebot/entrypoints/test_autosync.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Test for Autosync CLI"""

Expand Down
18 changes: 3 additions & 15 deletions tests/trestlebot/entrypoints/test_entrypoint_base.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Test for Entrypoint Base"""

Expand Down
18 changes: 3 additions & 15 deletions tests/trestlebot/entrypoints/test_sync_upstreams.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2024 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Red Hat, Inc.


"""Test for Sync Upstreams CLI"""

Expand Down
16 changes: 2 additions & 14 deletions tests/trestlebot/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

# Copyright 2023 Red Hat, Inc.
#
# 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.
"""Test tasks package."""
16 changes: 2 additions & 14 deletions tests/trestlebot/tasks/authored/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.

# Copyright 2023 Red Hat, Inc.
#
# 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.
"""Test authored package."""
18 changes: 3 additions & 15 deletions tests/trestlebot/tasks/authored/test_compdef.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Test for Trestle Bot Authored Compdef."""

Expand Down
18 changes: 3 additions & 15 deletions tests/trestlebot/tasks/authored/test_profile.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Test for Trestle Bot Authored Profile."""

Expand Down
18 changes: 3 additions & 15 deletions tests/trestlebot/tasks/authored/test_ssp.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Test for Trestle Bot Authored SSP."""

Expand Down
18 changes: 3 additions & 15 deletions tests/trestlebot/tasks/authored/test_types.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/python

# Copyright 2023 Red Hat, Inc.
#
# 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.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Red Hat, Inc.


"""Test author types for Trestlebot"""

Expand Down
Loading

0 comments on commit 929f84c

Please sign in to comment.