Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: CheckStyle checks copyright notice header #1197

Merged
merged 5 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
*
* OmegaT - Computer Assisted Translation (CAT) tool
* with fuzzy matching, translation memory, keyword search,
* glossaries, and translation leveraging into updated projects.
Expand Down
101 changes: 0 additions & 101 deletions aligner/src/test/java/org/omegat/gui/align/CopyrightTest.java

This file was deleted.

12 changes: 12 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

<module name="RegexpHeader">
<property name="headerFile" value="${config_loc}/java.header"/>
<property name="multiLines" value="6"/>
<property name="fileExtensions" value="java"/>
</module>

<module name="RegexpHeader">
<property name="headerFile" value="${config_loc}/properties.header"/>
<property name="multiLines" value="6"/>
<property name="fileExtensions" value="properties"/>
</module>

<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/checks/sizes/index.html -->
<module name="FileLength"/>
Expand Down
24 changes: 24 additions & 0 deletions config/checkstyle/java.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
^/\*(\*{73,})?$
OmegaT \- Computer Assisted Translation \(CAT\) tool$
with fuzzy matching, translation memory, keyword search,$
glossaries, and translation leveraging into updated projects.$
^( \*)?$
(Copyright \(C\)|\s{13}) \d\d\d\d((-|,)\d\d\d\d)? (\w+|\s|,)+
Home page: https://www.omegat.org/
Support center: https://omegat.org/support
^( \*)?$
This file is part of OmegaT.$
^( \*)?$
OmegaT is free software: you can redistribute it and/or modify$
it under the terms of the GNU General Public License as published by$
the Free Software Foundation, either version 3 of the License, or$
\(at your option\) any later version.$
^( \*)?$
OmegaT is distributed in the hope that it will be useful,$
but WITHOUT ANY WARRANTY; without even the implied warranty of$
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the$
GNU General Public License for more details.$
^( \*)?$
You should have received a copy of the GNU General Public License$
along with this program. If not, see <https://www.gnu.org/licenses/>.$
^\s?(\*{73,})?\*/$
24 changes: 24 additions & 0 deletions config/checkstyle/properties.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
^#(/?\*{75,})?$
^# OmegaT \- Computer Assisted Translation \(CAT\) tool$
^# with fuzzy matching, translation memory, keyword search,$
^# glossaries, and translation leveraging into updated projects.$
^#$
^# (Copyright \(C\)|\s{13}) \d\d\d\d(-\d\d\d\d)? (\w+|\s|,)+
^# Home page: https://www.omegat.org/
^# Support center: https://omegat.org/support
^#$
^# This file is part of OmegaT.$
^#$
^# OmegaT is free software: you can redistribute it and/or modify$
^# it under the terms of the GNU General Public License as published by$
^# the Free Software Foundation, either version 3 of the License, or$
^# \(at your option\) any later version.$
^# ^( \*)?$
^# OmegaT is distributed in the hope that it will be useful,$
^# but WITHOUT ANY WARRANTY; without even the implied warranty of$
^# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the$
^# GNU General Public License for more details.$
^#$
^# You should have received a copy of the GNU General Public License$
^# along with this program. If not, see <https://www.gnu.org/licenses/>.$
^#(\*{75,}/?)?$
5 changes: 4 additions & 1 deletion config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<suppressions>

<!-- Permanently suppress errors/warnings -->

<!-- ignore -->
<suppress files="gen.core.*+" checks="RegexpHeader"/>

<!-- tests -->
<suppress files="TestCore\.java" checks="MethodLength"/>
Expand Down Expand Up @@ -161,7 +164,7 @@
<suppress checks="(TypeName|MissingSwitchDefault)" files="srtFilter\.java" lines="55,102"/>
<suppress checks="TypeName" files="XLIFFOptions\.java" lines="67"/>
<suppress files="XHTMLDialect\.java" checks="InnerAssignment" lines="131,132"/>
<suppress files="CamtasiaWindowsDialect\.java" checks="MethodLength" lines="45"/>
<suppress files="CamtasiaWindowsDialect\.java" checks="MethodLength" lines="44"/>
<suppress files="Entry\.java" checks="MethodLength"/>
<suppress files="Handler\.java" checks="EmptyBlock" lines="857"/>

Expand Down
11 changes: 4 additions & 7 deletions doc_src/build.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
/**************************************************************************
OmegaT - Java based Computer Assisted Translation (CAT) tool
OmegaT - Computer Assisted Translation (CAT) tool

Copyright (C) 2011-2012 Didier Briel
2014-2015 Didier Briel
2019 Aaron Madlon-Kay

Home page: http://www.omegat.org/
Home page: https://www.omegat.org/
Support center: https://omegat.org/support

This file is part of OmegaT.
Expand All @@ -23,8 +21,7 @@
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<project name="OmegaT documentation" default="all">

Expand Down

This file was deleted.

Loading
Loading