Skip to content

Commit

Permalink
ci: add license header pre-commit hook
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Focko <[email protected]>
  • Loading branch information
mfocko committed Feb 27, 2024
1 parent b88e5cc commit 32cfbe9
Show file tree
Hide file tree
Showing 81 changed files with 258 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/notify.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3

# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT

import datetime
import logging
import os
Expand Down
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,27 @@ repos:
hooks:
- id: check-github-workflows
args: ["--verbose"]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: insert-license-python
types:
- python
args:
- --license-filepath
- LICENSE_HEADER.txt
- --comment-style
- "#"
- id: insert-license
name: insert-license-frontend
types_or:
- javascript
- jsx
- ts
- tsx
args:
- --license-filepath
- LICENSE_HEADER.txt
- --comment-style
- "//"
2 changes: 2 additions & 0 deletions LICENSE_HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright Contributors to the Packit project.
SPDX-License-Identifier: MIT
3 changes: 3 additions & 0 deletions frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
Expand Down
3 changes: 3 additions & 0 deletions frontend/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { initialize, mswLoader } from "msw-storybook-addon";
// To get PatternFly style to work out of the box we need to import the CSS here
import "@patternfly/react-core/dist/styles/base.css";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import "@patternfly/react-core/dist/styles/base.css";
import "@patternfly/patternfly/patternfly-addons.css";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/AppLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
NavLink,
Outlet,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
Card,
CardHeader,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Errors/ErrorApp.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { withRouter } from "storybook-addon-react-router-v6";
import type { Meta, StoryObj } from "@storybook/react";
import { ErrorApp } from "./ErrorApp";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Errors/ErrorApp.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
Button,
ClipboardCopyButton,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Errors/ErrorConnection.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { ErrorConnection } from "./ErrorConnection";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Errors/ErrorConnection.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
EmptyState,
EmptyStateIcon,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Forge/ForgeIcon.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { rest } from "msw";
import { withQueryClient } from "../utils/storybook/withQueryClient";
import { withRouter } from "storybook-addon-react-router-v6";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Forge/ForgeIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";

import { Tooltip } from "@patternfly/react-core";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/.fixtures/CoprBuildsData.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

export const CoprBuildData = [
{
packit_id: 25732,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/BodhiUpdatesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/CoprBuildsTable.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { CoprBuildsTable } from "./CoprBuildsTable";
import { rest } from "msw";
import { withQueryClient } from "../utils/storybook/withQueryClient";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/CoprBuildsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/Jobs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { rest } from "msw";
import { withQueryClient } from "../utils/storybook/withQueryClient";
import { withRouter } from "storybook-addon-react-router-v6";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/Jobs.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
Nav,
NavItem,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/KojiBuildsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/SRPMBuildsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/SyncReleaseStatuses.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Jobs/TestingFarmResultsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/NotFound/NotFound.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { NotFound } from "./NotFound";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/NotFound/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import * as React from "react";
import { Alert, PageSection } from "@patternfly/react-core";

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Pipelines/Pipelines.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Pipelines/PipelinesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";

import { TableVariant, cellWidth, IRow } from "@patternfly/react-table";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Preloader/Preloader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import { Spinner } from "@patternfly/react-core";

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/BranchList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useState, useId } from "react";

import { ErrorConnection } from "../Errors/ErrorConnection";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/Forge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import { rest } from "msw";
import { withQueryClient } from "../utils/storybook/withQueryClient";
import { withRouter } from "storybook-addon-react-router-v6";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/Forge.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
PageSection,
PageSectionVariants,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/IssuesList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";

import { ErrorConnection } from "../Errors/ErrorConnection";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/Namespace.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/ProjectInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/ProjectSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useState } from "react";
import {
Alert,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/Projects.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/ProjectsList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo } from "react";
import { Button } from "@patternfly/react-core";

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/PullRequestList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useMemo, useState } from "react";

import { ErrorConnection } from "../Errors/ErrorConnection";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Projects/ReleasesList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";

import { ErrorConnection } from "../Errors/ErrorConnection";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageBodhiUpdate.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageCopr.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
PageSection,
Card,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageCoprDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import {
Label,
DescriptionList,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageKoji.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageSRPM.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useState } from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Results/ResultsPageTestingFarm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useEffect, useState } from "react";
import {
PageSection,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/StatusLabel/BaseStatusLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import { Label, Tooltip } from "@patternfly/react-core";
import { Link } from "react-router-dom";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/StatusLabel/StatusLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useEffect, useState } from "react";
import {
CheckCircleIcon,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/StatusLabel/SyncReleaseTargetStatusLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useEffect, useState } from "react";
import { Spinner } from "@patternfly/react-core";
import {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Support/Support.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import * as React from "react";
import { CubesIcon } from "@patternfly/react-icons";
import {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Trigger/TriggerInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React, { useState } from "react";

import { Label } from "@patternfly/react-core";
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Trigger/TriggerLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
getPRLink,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/Usage/Usage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT

import React from "react";
import {
PageSection,
Expand Down
Loading

0 comments on commit 32cfbe9

Please sign in to comment.