Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
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
244 changes: 244 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
---

# Copyright 2025 Humberto Gomes, José Lopes, Mariana Rocha
#
# 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.

# GENERAL SETTINGS

BasedOnStyle: LLVM
Language: Java
Standard: Latest

# ALIGNMENT

AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
QualifierAlignment: Leave

AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true

# ARGUMENTS & PARAMETERS

AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackArguments: false
BinPackParameters: false

# COMMENTS

ReflowComments: true
SpacesBeforeTrailingComments: 1
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1

# CURLY BRACES

BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

BreakBeforeBraces: Attach
InsertBraces: false
RemoveBracesLLVM: false

# FORMATTER PENALTIES

PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60

# HEADER FILES

SortIncludes: CaseInsensitive
SortUsingDeclarations: Lexicographic
SortJavaStaticImport: After
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<'
Priority: 0
SortPriority: 0
CaseSensitive: false
- Regex: '^"'
Priority: 1
SortPriority: 1
CaseSensitive: false

IncludeIsMainRegex: ''
IncludeIsMainSourceRegex: ''

JavaImportGroups: [java, org.example]

# INDENTATION

ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentWidth: 4
PPIndentWidth: 4
TabWidth: 4
UseTab: Never

IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWrappedFunctionNames: true
LambdaBodyIndentation: Signature
NamespaceIndentation: None
RequiresExpressionIndentation: OuterScope

# LINE BREAKING

AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
BreakAfterAttributes: Always
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
PackConstructorInitializers: NextLine
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Always

# LINE PROPERTIES

ColumnLimit: 100
LineEnding: LF

KeepEmptyLinesAtTheStartOfBlocks: true
KeepEmptyLinesAtEOF: false
MaxEmptyLinesToKeep: 1
InsertNewlineAtEOF: true

# MACROS

AttributeMacros: []
ForEachMacros: []
IfMacros: []
NamespaceMacros: []
StatementAttributeLikeMacros: []
StatementMacros: []
TypenameMacros: []
WhitespaceSensitiveMacros: []

# MISCELANEOUS

CompactNamespaces: false
DisableFormat: false
FixNamespaceComments: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 4
BinaryMinDigits: 9
Decimal: 3
DecimalMinDigits: 7
Hex: -1

RemoveParentheses: Leave
RemoveSemicolon: true

# SINGLE-LINE BLOCKS AND STATEMENTS

AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false

# SPACING

DerivePointerAlignment: false
PointerAlignment: Right
ReferenceAlignment: Pointer
SpaceAroundPointerQualifiers: Default

BitFieldColonSpacing: Both
Cpp11BracedListStyle: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false

SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInSquareBrackets: false
SpacesInParensOptions:
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
...
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text eol=lf
*.jar binary
32 changes: 32 additions & 0 deletions .github/workflows/maintenance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Maintenance checks
on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'build.gradle.kts'
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: >-
sudo apt update &&
sudo apt install wget &&
wget https://apt.llvm.org/llvm.sh &&
sudo bash ./llvm.sh 19 &&
(sudo rm /usr/bin/clang-format || exit 0) &&
sudo apt -y install clang-format-19
- run: find src -type f | xargs -n1 clang-format-19 --dry-run -Werror

build:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- run: ./gradlew --no-daemon build
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# IDEs
.vscode
.idea

# Build artifacts
.gradle
build
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,30 @@ year's [Object Oriented Programming Project](https://github.com/pedrofp4444/POO)
- Humberto Gomes (A104348)
- José Lopes (A104541)
- Mariana Rocha (A90817)

### Running

To get the code in this repository, clone it:

```
$ git clone https://github.com/voidbert/ATS.git
$ cd ATS
```

Then, you can build run the application:

```
$ gradle run
```

There are multiple test suites. To execute the tests written by the previous authors, run:

```
$ gradle test -PtestDir=oldunittests
```

To execute the new unit tests, run:

```
$ gradle test
```
72 changes: 72 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright 2025 Humberto Gomes, José Lopes, Mariana Rocha
*
* 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.
*/

// Project configuration

plugins {
application
jacoco
}

repositories {
mavenCentral()
}

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.12.1")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.12.1")
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

application {
mainClass = "MakeItFit.Main"
}

jacoco {
toolVersion = "0.8.13"
}

// Test configuration

var testTarget = "unittests"
if (project.hasProperty("testDir")) {
testTarget = project.property("testDir").toString()
}

java.sourceSets["test"].java {
srcDir("src/${testTarget}/java")
}

tasks.named<Test>("test") {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}

// Other tasks

tasks.named<JavaExec>("run") {
standardInput = System.`in`
}

tasks.register<Exec>("format") {
workingDir = file(rootDir)
commandLine = listOf("sh", "-c", "find src -type f | xargs -n1 sh -c 'clang-format -i $0; sed -i s/\\\\r//g $0'")
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading