Skip to content

Commit

Permalink
Add some lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Dec 3, 2022
1 parent 36daf53 commit b119a11
Show file tree
Hide file tree
Showing 161 changed files with 7,909 additions and 7,894 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ assignees: ''


**Information:**
- Operating System:
- Celeste Version:
- Operating System:
- Celeste Version:
- Everest Version:


Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Check for tabs
run: |
find "(" -name "*.cs" -or -name "*.lua" -or -name "*.jl" -or -name "*.xml" -or -name "*.yaml" -or -name "*.yml" -or -name "*.txt" -or -name "*.md" ")" -exec grep -Pl "\t" {} \; > matches.txt
grep "" matches.txt && exit 1 || echo "No tab found!"
- name: Check for CRLF
run: |
find "(" -name "*.cs" -or -name "*.lua" -or -name "*.jl" -or -name "*.xml" -or -name "*.yaml" -or -name "*.yml" -or -name "*.txt" -or -name "*.md" ")" -exec grep -Plz "\r\n" {} \; > matches.txt
grep "" matches.txt && exit 1 || echo "No CRLF found!"
- name: Check for trailing spaces
run: |
find "(" -name "*.cs" -or -name "*.lua" -or -name "*.jl" -or -name "*.xml" -or -name "*.yaml" -or -name "*.yml" -or -name "*.txt" -or -name "*.md" ")" -exec grep -Pl " $" {} \; > matches.txt
grep "" matches.txt && exit 1 || echo "No trailing space found!"
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
Expand Down
28 changes: 14 additions & 14 deletions Ahorn/effects/blackholeCustomColors.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module SpringCollab2020BlackholeCustomColors

using ..Ahorn, Maple

@mapdef Effect "SpringCollab2020/BlackholeCustomColors" BlackholeCustomColors(only::String="*", exclude::String="", colorsMild::String="6e3199,851f91,3026b0", colorsWild::String="ca4ca7,b14cca,ca4ca7",
bgColorInner::String="000000", bgColorOuterMild::String="512a8b", bgColorOuterWild::String="bd2192", alpha::Number=1.0)

placements = BlackholeCustomColors

function Ahorn.canFgBg(effect::BlackholeCustomColors)
return true, true
end

end
module SpringCollab2020BlackholeCustomColors

using ..Ahorn, Maple

@mapdef Effect "SpringCollab2020/BlackholeCustomColors" BlackholeCustomColors(only::String="*", exclude::String="", colorsMild::String="6e3199,851f91,3026b0", colorsWild::String="ca4ca7,b14cca,ca4ca7",
bgColorInner::String="000000", bgColorOuterMild::String="512a8b", bgColorOuterWild::String="bd2192", alpha::Number=1.0)

placements = BlackholeCustomColors

function Ahorn.canFgBg(effect::BlackholeCustomColors)
return true, true
end

end
26 changes: 13 additions & 13 deletions Ahorn/effects/customSnow.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module SpringCollab2020CustomSnow

using ..Ahorn, Maple

@mapdef Effect "SpringCollab2020/CustomSnow" CustomSnow(only::String="*", exclude::String="", colors::String="FFFFFF,FFFFFF")

placements = CustomSnow

function Ahorn.canFgBg(effect::CustomSnow)
return true, true
end

end
module SpringCollab2020CustomSnow

using ..Ahorn, Maple

@mapdef Effect "SpringCollab2020/CustomSnow" CustomSnow(only::String="*", exclude::String="", colors::String="FFFFFF,FFFFFF")

placements = CustomSnow

function Ahorn.canFgBg(effect::CustomSnow)
return true, true
end

end
26 changes: 13 additions & 13 deletions Ahorn/effects/heatWaveNoColorGrade.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module SpringCollab2020HeatWaveNoColorGrade

using ..Ahorn, Maple

@mapdef Effect "SpringCollab2020/HeatWaveNoColorGrade" HeatWaveNoColorGrade(only::String="*", exclude::String="")

placements = HeatWaveNoColorGrade

function Ahorn.canFgBg(effect::HeatWaveNoColorGrade)
return true, true
end

end
module SpringCollab2020HeatWaveNoColorGrade

using ..Ahorn, Maple

@mapdef Effect "SpringCollab2020/HeatWaveNoColorGrade" HeatWaveNoColorGrade(only::String="*", exclude::String="")

placements = HeatWaveNoColorGrade

function Ahorn.canFgBg(effect::HeatWaveNoColorGrade)
return true, true
end

end
2 changes: 1 addition & 1 deletion Ahorn/entities/animatedJumpthruPlatform.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SpringCollab2020AnimatedJumpthruPlatform
module SpringCollab2020AnimatedJumpthruPlatform

using ..Ahorn, Maple

Expand Down
154 changes: 77 additions & 77 deletions Ahorn/entities/attachedIceWall.jl
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
module SpringCollab2020AttachedIceWall

using ..Ahorn, Maple

@mapdef Entity "SpringCollab2020/AttachedIceWall" AttachedIceWall(x::Integer, y::Integer, height::Integer=8, left::Bool=false)

const placements = Ahorn.PlacementDict(
"Attached Ice Wall (Right) (Spring Collab 2020)" => Ahorn.EntityPlacement(
AttachedIceWall,
"rectangle",
Dict{String, Any}(
"left" => true
)
),
"Attached Ice Wall (Left) (Spring Collab 2020)" => Ahorn.EntityPlacement(
AttachedIceWall,
"rectangle",
Dict{String, Any}(
"left" => false
)
)
)

Ahorn.minimumSize(entity::AttachedIceWall) = 0, 8
Ahorn.resizable(entity::AttachedIceWall) = false, true

function Ahorn.selection(entity::AttachedIceWall)
x, y = Ahorn.position(entity)
height = Int(get(entity.data, "height", 8))

return Ahorn.Rectangle(x, y, 8, height)
end

function Ahorn.render(ctx::Ahorn.Cairo.CairoContext, entity::AttachedIceWall, room::Maple.Room)
left = get(entity.data, "left", false)

# Values need to be system specific integer
x = Int(get(entity.data, "x", 0))
y = Int(get(entity.data, "y", 0))

height = Int(get(entity.data, "height", 8))
tileHeight = div(height, 8)

if left
for i in 2:tileHeight - 1
Ahorn.drawImage(ctx, "objects/wallBooster/iceMid00", 0, (i - 1) * 8)
end

Ahorn.drawImage(ctx, "objects/wallBooster/iceTop00", 0, 0)
Ahorn.drawImage(ctx, "objects/wallBooster/iceBottom00", 0, (tileHeight - 1) * 8)

else
Ahorn.Cairo.save(ctx)
Ahorn.scale(ctx, -1, 1)

for i in 2:tileHeight - 1
Ahorn.drawImage(ctx, "objects/wallBooster/iceMid00", -8, (i - 1) * 8)
end

Ahorn.drawImage(ctx, "objects/wallBooster/iceTop00", -8, 0)
Ahorn.drawImage(ctx, "objects/wallBooster/iceBottom00", -8, (tileHeight - 1) * 8)

Ahorn.restore(ctx)
end
end

# Offset X position so it flips in place
function Ahorn.flipped(entity::AttachedIceWall, horizontal::Bool)
if horizontal
entity.left = !entity.left
entity.x += entity.left ? 8 : -8

return entity
end
end

end
module SpringCollab2020AttachedIceWall

using ..Ahorn, Maple

@mapdef Entity "SpringCollab2020/AttachedIceWall" AttachedIceWall(x::Integer, y::Integer, height::Integer=8, left::Bool=false)

const placements = Ahorn.PlacementDict(
"Attached Ice Wall (Right) (Spring Collab 2020)" => Ahorn.EntityPlacement(
AttachedIceWall,
"rectangle",
Dict{String, Any}(
"left" => true
)
),
"Attached Ice Wall (Left) (Spring Collab 2020)" => Ahorn.EntityPlacement(
AttachedIceWall,
"rectangle",
Dict{String, Any}(
"left" => false
)
)
)

Ahorn.minimumSize(entity::AttachedIceWall) = 0, 8
Ahorn.resizable(entity::AttachedIceWall) = false, true

function Ahorn.selection(entity::AttachedIceWall)
x, y = Ahorn.position(entity)
height = Int(get(entity.data, "height", 8))

return Ahorn.Rectangle(x, y, 8, height)
end

function Ahorn.render(ctx::Ahorn.Cairo.CairoContext, entity::AttachedIceWall, room::Maple.Room)
left = get(entity.data, "left", false)

# Values need to be system specific integer
x = Int(get(entity.data, "x", 0))
y = Int(get(entity.data, "y", 0))

height = Int(get(entity.data, "height", 8))
tileHeight = div(height, 8)

if left
for i in 2:tileHeight - 1
Ahorn.drawImage(ctx, "objects/wallBooster/iceMid00", 0, (i - 1) * 8)
end

Ahorn.drawImage(ctx, "objects/wallBooster/iceTop00", 0, 0)
Ahorn.drawImage(ctx, "objects/wallBooster/iceBottom00", 0, (tileHeight - 1) * 8)

else
Ahorn.Cairo.save(ctx)
Ahorn.scale(ctx, -1, 1)

for i in 2:tileHeight - 1
Ahorn.drawImage(ctx, "objects/wallBooster/iceMid00", -8, (i - 1) * 8)
end

Ahorn.drawImage(ctx, "objects/wallBooster/iceTop00", -8, 0)
Ahorn.drawImage(ctx, "objects/wallBooster/iceBottom00", -8, (tileHeight - 1) * 8)

Ahorn.restore(ctx)
end
end

# Offset X position so it flips in place
function Ahorn.flipped(entity::AttachedIceWall, horizontal::Bool)
if horizontal
entity.left = !entity.left
entity.x += entity.left ? 8 : -8

return entity
end
end

end
26 changes: 13 additions & 13 deletions Ahorn/entities/bubblePushField.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module SpringCollab2020BubblePushField
module SpringCollab2020BubblePushField

using ..Ahorn, Maple

@mapdef Entity "SpringCollab2020/bubblePushField" BubblePushField(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight,
strength::Number=1.0, upwardStrength::Number=1.0, direction::String="Right", water::Bool=true, flag::String="bubble_push_field", activationMode::String="Always")
strength::Number=1.0, upwardStrength::Number=1.0, direction::String="Right", water::Bool=true, flag::String="bubble_push_field", activationMode::String="Always")

const placements = Ahorn.PlacementDict(
"Bubble Column (Spring Collab 2020)" => Ahorn.EntityPlacement(
BubblePushField,
"rectangle"
)
"Bubble Column (Spring Collab 2020)" => Ahorn.EntityPlacement(
BubblePushField,
"rectangle"
)
)

Ahorn.editingOptions(entity::BubblePushField) = Dict{String,Any}(
"direction" => ["Up", "Down", "Left", "Right"],
"activationMode" => ["Always", "OnlyWhenFlagActive", "OnlyWhenFlagInactive"]
"direction" => ["Up", "Down", "Left", "Right"],
"activationMode" => ["Always", "OnlyWhenFlagActive", "OnlyWhenFlagInactive"]
)

Ahorn.minimumSize(entity::BubblePushField) = 8, 8
Expand All @@ -23,13 +23,13 @@ Ahorn.resizable(entity::BubblePushField) = true, true
Ahorn.selection(entity::BubblePushField) = Ahorn.getEntityRectangle(entity)

function Ahorn.render(ctx::Ahorn.Cairo.CairoContext, entity::BubblePushField, room::Maple.Room)
x = Int(get(entity.data, "x", 0))
y = Int(get(entity.data, "y", 0))
x = Int(get(entity.data, "x", 0))
y = Int(get(entity.data, "y", 0))

width = Int(get(entity.data, "width", 32))
height = Int(get(entity.data, "height", 32))
width = Int(get(entity.data, "width", 32))
height = Int(get(entity.data, "height", 32))

Ahorn.drawRectangle(ctx, 0, 0, width, height, (0.7, 0.28, 0.0, 0.34), (1.0, 1.0, 1.0, 0.5))
Ahorn.drawRectangle(ctx, 0, 0, width, height, (0.7, 0.28, 0.0, 0.34), (1.0, 1.0, 1.0, 0.5))
end

end
Loading

0 comments on commit b119a11

Please sign in to comment.