Skip to content

Commit fbe4b79

Browse files
authored
Merge pull request #3 from bcExpt1123/test
Add interactive console menu system for data structure demonstrations
2 parents 8572c28 + f569726 commit fbe4b79

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1002
-340
lines changed

.github/workflows/codeql.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CodeQL analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 3 * * 0'
10+
11+
jobs:
12+
call-codeQL-analysis:
13+
name: CodeQL analysis
14+
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main

.github/workflows/label_pr.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will triage pull requests and apply a label based on the
2+
# paths that are modified in the pull request.
3+
#
4+
# To use this workflow, you will need to set up a .github/labeler.yml
5+
# file with configuration. For more information, see:
6+
# https://github.com/actions/labeler
7+
8+
name: Pull Request Labeler
9+
on: [pull_request_target]
10+
11+
jobs:
12+
label:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
19+
steps:
20+
- uses: actions/labeler@v5
21+
with:
22+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/maven.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Java CI with Maven
10+
11+
on:
12+
push:
13+
branches: [ "main" ]
14+
pull_request:
15+
branches: [ "main" ]
16+
17+
jobs:
18+
build:
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up JDK 23
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '23'
28+
distribution: 'temurin'
29+
cache: maven
30+
- name: Build with Maven
31+
run: mvn -B package --file pom.xml
32+
33+
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
34+
- name: Update dependency graph
35+
if: github.event_name == 'push'
36+
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

.github/workflows/pmd.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: pmd
7+
8+
on:
9+
push:
10+
branches: [ "main" ]
11+
pull_request:
12+
branches: [ "main" ]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
pmd-code-scan:
19+
permissions:
20+
contents: read # for actions/checkout to fetch code
21+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
22+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up JDK 11
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '11'
30+
distribution: 'temurin'
31+
- name: Run PMD
32+
id: pmd
33+
uses: pmd/pmd-github-action@v2
34+
with:
35+
rulesets: 'rulesets/java/quickstart.xml'
36+
sourcePath: 'src/main/java'
37+
analyzeModifiedFilesOnly: false
38+
- name: Upload SARIF file
39+
uses: github/codeql-action/upload-sarif@v3
40+
with:
41+
sarif_file: pmd-report.sarif
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Summarize new issues
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
summary:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
contents: read
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Run AI inference
19+
id: inference
20+
uses: actions/ai-inference@v1
21+
with:
22+
prompt: |
23+
Summarize the following GitHub issue in one paragraph:
24+
Title: ${{ github.event.issue.title }}
25+
Body: ${{ github.event.issue.body }}
26+
27+
- name: Comment with AI summary
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
ISSUE_NUMBER: ${{ github.event.issue.number }}
31+
RESPONSE: ${{ steps.inference.outputs.response }}
32+
run: |
33+
gh issue comment "$ISSUE_NUMBER" --body "$RESPONSE"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Thank you for taking the time to contribute to this project! Here are a few guid
88

99
2. **Clone the repository**: Clone your forked repository to your local machine using the following command:
1010
```sh
11-
git clone https://github.com/your-username/java-alda.git
11+
git clone https://github.com/your-username/java-dsa.git
1212
```
1313

1414
3. **Create a branch**: Create a new branch for your work using the following command:

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Java Algorithms and Data Structures
1+
# Java Data Structures and Algorithms
22

33
This repository contains implementations of various algorithms and data structures in Java. It is intended as a resource for learning and reference.
44

@@ -94,11 +94,11 @@ Implementation and usage of graphs.
9494

9595
1. Clone the repository:
9696
```sh
97-
git clone https://github.com/bcExpt1123/java-alda.git
97+
git clone https://github.com/bcExpt1123/java-dsa.git
9898
```
9999
2. Navigate to the project directory:
100100
```sh
101-
cd java-alda
101+
cd java-dsa
102102
```
103103

104104
## Usage
@@ -107,11 +107,21 @@ Run code:
107107
```sh
108108
mvn clean compile exec:java
109109
```
110+
110111
Run test:
111112
```sh
112113
mvn test
113114
```
114115

116+
Run Check style:
117+
```sh
118+
mvn checkstyle:check
119+
```
120+
Or
121+
```sh
122+
mvn checkstyle:checkstyle
123+
```
124+
115125
## Contributing
116126

117127
Contributions are welcome! Please read the [contributing guidelines](CONTRIBUTING.md) for more details.

checkstyle.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
6+
<module name="Checker">
7+
8+
<!-- Line length should be a direct child of Checker -->
9+
<module name="LineLength">
10+
<property name="max" value="120"/>
11+
</module>
12+
13+
<module name="TreeWalker">
14+
<module name="EmptyBlock"/>
15+
<module name="LeftCurly"/>
16+
<module name="RightCurly"/>
17+
<module name="NeedBraces"/>
18+
<module name="WhitespaceAfter"/>
19+
<module name="WhitespaceAround"/>
20+
</module>
21+
</module>

pom.xml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>org.example</groupId>
8-
<artifactId>algo-datastructure</artifactId>
8+
<artifactId>java-dsa</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

1111
<properties>
1212
<maven.compiler.source>23</maven.compiler.source>
1313
<maven.compiler.target>23</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<exec.mainClass>org.alda.Main</exec.mainClass>
15+
<exec.mainClass>org.dsa.Main</exec.mainClass>
1616
</properties>
1717
<dependencies>
1818
<dependency>
@@ -28,5 +28,27 @@
2828
<scope>test</scope>
2929
</dependency>
3030
</dependencies>
31-
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-checkstyle-plugin</artifactId>
36+
<version>3.3.0</version>
37+
<executions>
38+
<execution>
39+
<phase>verify</phase>
40+
<goals>
41+
<goal>check</goal>
42+
</goals>
43+
</execution>
44+
</executions>
45+
<configuration>
46+
<configLocation>checkstyle.xml</configLocation>
47+
<encoding>UTF-8</encoding>
48+
<consoleOutput>true</consoleOutput>
49+
<failsOnError>true</failsOnError>
50+
</configuration>
51+
</plugin>
52+
</plugins>
53+
</build>
3254
</project>

0 commit comments

Comments
 (0)