Skip to content

Commit b21828e

Browse files
committed
Merge remote-tracking branch 'origin/master' into ch12-achintya
2 parents eec1212 + 01e596d commit b21828e

203 files changed

Lines changed: 5922 additions & 2807 deletions

File tree

Some content is hidden

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

.DS_Store

-6 KB
Binary file not shown.

.github/workflows/java.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Uses: https://github.com/marketplace/actions/prettier-java-action
2+
# Auto formats code using Prettier
3+
# Uses: https://github.com/marketplace/actions/run-java-checkstyle
4+
# Submits review annotations based on checkstyle errors
5+
6+
name: Java Style
7+
8+
on: pull_request
9+
10+
jobs:
11+
prettify:
12+
name: Prettify Java
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out Git repository
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Prettify the Java code
22+
uses: lwerner-lshigh/prettier_action_java@v1.1.1
23+
with:
24+
### Prettier Options ###
25+
# --no-semi overrides prettier printing semicolons
26+
# at the ends of all statements
27+
# --tab-width 4 sets the tab width to 4 spaces
28+
# --write *.java formats all .java files
29+
prettier_options: '--no-semi --tab-width 4 --write **/*.java'
30+
branch: ${{ github.head_ref }}
31+
commit_message: 'Bot: Prettified Java code!'
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
checkstyle:
36+
name: Java Checkstyle
37+
runs-on: ubuntu-latest
38+
needs: prettify
39+
40+
steps:
41+
- name: Check out Git repository
42+
uses: actions/checkout@v2
43+
44+
- name: Run checkstyle with reviewdog
45+
uses: nikitasavinov/checkstyle-action@master
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
reporter: github-pr-review # submit review comments based on reviewdog findings
49+
filter_mode: file # report on anything that is in an added/modified file
50+
fail_on_error: true
51+
checkstyle_config: google_checks_mod.xml
52+
workdir: src/com/codefortomorrow # working dir relative to root dir

.github/workflows/main.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,4 @@
33

44
# ignore files
55
c4t-java.iml
6-
*.xml
7-
.DS_Store
8-
*.class
9-
*.zip
10-
*.txt
6+
.DS_Store

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 4,
3+
"semi": false,
4+
"bracketSpacing": false
5+
}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Java
22
Source code from Code For Tomorrow's Java course
33

4+
![Java (Prettier)](https://github.com/code-for-tomorrow/java/workflows/Java%20(Prettier)/badge.svg)
5+
![Java (Checkstyle)](https://github.com/code-for-tomorrow/java/workflows/Java%20(Checkstyle)/badge.svg)
6+
47
All source code is under `src/com/codefortomorrow`
58

69
All class files are under `out/production/c4t-java/com/codefortomorrow`

0 commit comments

Comments
 (0)