Skip to content

Commit 94b830a

Browse files
authored
ci: set up lint (#29)
* ci: set up lint * style: fix lint errors * fix: includes ordering
1 parent d818d1a commit 94b830a

File tree

68 files changed

+3257
-3277
lines changed

Some content is hidden

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

68 files changed

+3257
-3277
lines changed

.github/workflows/linter.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
#################################
3+
#################################
4+
## Super Linter GitHub Actions ##
5+
#################################
6+
#################################
7+
name: Lint Code Base
8+
9+
#############################
10+
# Start the job on all push #
11+
#############################
12+
on:
13+
push:
14+
branches-ignore: [main]
15+
# Remove the line above to run when pushing to master
16+
pull_request:
17+
branches: [main]
18+
19+
###############
20+
# Set the Job #
21+
###############
22+
jobs:
23+
build:
24+
# Name the Job
25+
name: Lint Code Base
26+
# Set the agent to run on
27+
runs-on: ubuntu-latest
28+
29+
############################################
30+
# Grant status permission for MULTI_STATUS #
31+
############################################
32+
permissions:
33+
contents: read
34+
packages: read
35+
statuses: write
36+
37+
##################
38+
# Load all steps #
39+
##################
40+
steps:
41+
##########################
42+
# Checkout the code base #
43+
##########################
44+
- name: Checkout Code
45+
uses: actions/checkout@v3
46+
with:
47+
# Full git history is needed to get a proper
48+
# list of changed files within `super-linter`
49+
fetch-depth: 0
50+
51+
################################
52+
# Run Linter against code base #
53+
################################
54+
- name: Lint Code Base
55+
uses: github/super-linter@v5
56+
env:
57+
VALIDATE_ALL_CODEBASE: true
58+
DEFAULT_BRANCH: main
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
VALIDATE_MARKDOWN: false
61+
VALIDATE_GITLEAKS: false
62+
VALIDATE_JSCPD: false
63+
VALIDATE_JAVA: false
64+
VALIDATE_GOOGLE_JAVA_FORMAT: false

CPPLINT.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
filter=-whitespace,-legal/copyright,-readability/todo,-build/header_guard,-build/include_order

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You must register your application as an OAuth 2.0 **Native** client.
3939
The name you wish to use to identify your application.
4040

4141
#### Logout URLs
42-
Native clients don't make use of Logout URLs, you might set your own website or https://localhost:3000 as this is a required field.
42+
Native clients don't make use of Logout URLs, you might set your own site or https://localhost:3000 as this is a required field.
4343

4444
#### Callback URLs
4545
On Android, iOS and macOS clients, you should set your application's deep link scheme (e.g. `mygame://callback`) if you wish to make use of [PKCE login](#android-and-ios-pkce-login-unreal-engine-50-only), otherwise set the same as [Logout URLs](#logout-urls).
@@ -59,7 +59,7 @@ See [here](https://docs.immutable.com/docs/x/passport/register-application/) for
5959
>[git-lfs](https://git-lfs.github.com/): since `.uasset` and `.umap` files are stored on Git Large File Storage, ensure you have [git-lfs]((https://git-lfs.github.com/)) installed.
6060
6161
1. Clone the [unreal-immutable-sdk](https://github.com/immutable/unreal-immutable-sdk) repository or download the zip/tarball from one of the versions [here](https://github.com/immutable/unreal-immutable-sdk/tags)
62-
2. Copy the cloned repo into your project's `Plugins` folder, e.g.: `MyGame/Plugins/unreal-immutable-sdk`.
62+
2. Copy the cloned repository into your project's `Plugins` folder, e.g.: `MyGame/Plugins/unreal-immutable-sdk`.
6363
3. Restart your project (Unreal Editor & Rider), upon restart it should load the `unreal-sdk-plugin` and should be good to use.
6464

6565
> [!NOTE]
@@ -209,7 +209,7 @@ See the [ImmutablePassport.h](https://github.com/immutable/unreal-immutable-sdk/
209209
- Epic Games Launcher
210210
- Unreal Engine installed from the Epic Games Launcher; you will need every version that the plugin supports (currently 4.27, 5.0, 5.1, 5.2)
211211
- Visual Studio 2022 with C++ support
212-
- Jetbrains Rider IDE (recommended for working with Unreal Engine C++ code)
212+
- JetBrains Rider IDE (recommended for working with Unreal Engine C++ code)
213213

214214
If not Rider, Visual Studio is fine and even better with the Resharper plugin.
215215

@@ -229,13 +229,13 @@ In Unreal Engine 5.1+ the project is set up so that `console.log()` will pass al
229229

230230
#### Remote Debugging
231231

232-
To set up Chromium remote debugging, edit project build/launch configurations in your IDE to add the following program command line argument to the appropriate configurations: `cefdebug=9222`
232+
To set up Chromium remote debugging, edit project build/launch configurations in your IDE to add the following program command-line argument to the appropriate configurations: `cefdebug=9222`
233233

234234
Next, launch the game and then open a separate Chrome/Chromium browser and navigate to `chrome://inspect` where your app should be listed, sometimes intermittently or after a delay, under the `Remote Target #localhost` section. Click `inspect` to launch the remote debugging session.
235235

236236
## Release Unreal Immutable SDK Plugin
237237

238-
1. Release the plugin using github releases. See https://github.com/immutable/unreal-immutable-sdk/releases
238+
1. Release the plugin using GitHub releases. See https://github.com/immutable/unreal-immutable-sdk/releases
239239

240240
## Release Blui Plugin for UE4
241241

@@ -249,7 +249,7 @@ For UE4 we are using Blui as the in built browser does not work.
249249
```
250250
// BluManager::Settings.remote_debugging_port = 7777;
251251
```
252-
6. Zip the Blui plugin folder and upload to the github release.
252+
6. Zip the Blui plugin folder and upload to the GitHub release.
253253
254254
## How to Add Game Bridge Asset to Packaged Resources
255255

Source/Immutable/Immutable.Build.cs

+88-88
Original file line numberDiff line numberDiff line change
@@ -6,114 +6,114 @@
66

77
public class Immutable : ModuleRules
88
{
9-
public Immutable(ReadOnlyTargetRules Target) : base(Target)
10-
{
11-
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
12-
13-
#if UE_5_1_OR_LATER
9+
public Immutable(ReadOnlyTargetRules Target) : base(Target)
10+
{
11+
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
12+
13+
#if UE_5_1_OR_LATER
1414
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
15-
#endif
15+
#endif
1616

17-
PublicIncludePaths.AddRange(
18-
new string[]
19-
{
17+
PublicIncludePaths.AddRange(
18+
new string[]
19+
{
2020
// ... add public include paths required here ...
2121
}
22-
);
22+
);
2323

2424

25-
PrivateIncludePaths.AddRange(
26-
new string[]
27-
{
25+
PrivateIncludePaths.AddRange(
26+
new string[]
27+
{
2828
// ... add other private include paths required here ...
2929
}
30-
);
30+
);
3131

3232

33-
PublicDependencyModuleNames.AddRange(
34-
new string[]
35-
{
36-
"Core",
33+
PublicDependencyModuleNames.AddRange(
34+
new string[]
35+
{
36+
"Core",
3737
// ... add other public dependencies that you statically link with here ...
3838
}
39-
);
40-
41-
42-
PrivateDependencyModuleNames.AddRange(
43-
new string[]
44-
{
45-
"CoreUObject",
46-
"Engine",
47-
"Slate",
48-
"SlateCore",
49-
"Json",
50-
"JsonUtilities",
51-
"UMG",
52-
"Projects",
39+
);
40+
41+
42+
PrivateDependencyModuleNames.AddRange(
43+
new string[]
44+
{
45+
"CoreUObject",
46+
"Engine",
47+
"Slate",
48+
"SlateCore",
49+
"Json",
50+
"JsonUtilities",
51+
"UMG",
52+
"Projects",
5353
// ... add private dependencies that you statically link with here ...
5454
}
55-
);
56-
57-
#if UE_5_0_OR_LATER
55+
);
56+
57+
#if UE_5_0_OR_LATER
5858
PublicDependencyModuleNames.Add("WebBrowserWidget");
5959
PrivateDependencyModuleNames.Add("WebBrowser");
6060
PublicDefinitions.Add("USING_BUNDLED_CEF=1");
6161
PublicDefinitions.Add("USING_BLUI_CEF=0");
62-
#else
63-
if (Target.Platform == UnrealTargetPlatform.Win64)
64-
{
65-
PrivateDependencyModuleNames.Add("Blu");
66-
PublicDefinitions.Add("USING_BLUI_CEF=1");
67-
}
68-
else
69-
{
70-
PublicDefinitions.Add("USING_BLUI_CEF=0");
71-
}
62+
#else
63+
if (Target.Platform == UnrealTargetPlatform.Win64)
64+
{
65+
PrivateDependencyModuleNames.Add("Blu");
66+
PublicDefinitions.Add("USING_BLUI_CEF=1");
67+
}
68+
else
69+
{
70+
PublicDefinitions.Add("USING_BLUI_CEF=0");
71+
}
7272

73-
PublicDefinitions.Add("USING_BUNDLED_CEF=0");
74-
#endif
73+
PublicDefinitions.Add("USING_BUNDLED_CEF=0");
74+
#endif
7575

76-
DynamicallyLoadedModuleNames.AddRange(
77-
new string[]
78-
{
76+
DynamicallyLoadedModuleNames.AddRange(
77+
new string[]
78+
{
7979
// ... add any modules that your module loads dynamically here ...
8080
}
81-
);
82-
83-
if (Target.Platform == UnrealTargetPlatform.Android)
84-
{
85-
PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });
86-
87-
string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
88-
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "Immutable_UPL_Android.xml"));
89-
}
90-
91-
if (Target.Platform == UnrealTargetPlatform.IOS)
92-
{
93-
PrivateDependencyModuleNames.AddRange(new string[]{ "Launch" });
94-
95-
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "IOS") });
96-
97-
PublicFrameworks.AddRange(
98-
new string[]
99-
{
100-
"Foundation",
101-
"AuthenticationServices"
102-
}
103-
);
104-
}
105-
106-
if (Target.Platform == UnrealTargetPlatform.Mac)
107-
{
108-
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "Mac") });
109-
110-
PublicFrameworks.AddRange(
111-
new string[]
112-
{
113-
"Foundation",
114-
"AuthenticationServices"
115-
}
116-
);
117-
}
118-
}
81+
);
82+
83+
if (Target.Platform == UnrealTargetPlatform.Android)
84+
{
85+
PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });
86+
87+
string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
88+
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "Immutable_UPL_Android.xml"));
89+
}
90+
91+
if (Target.Platform == UnrealTargetPlatform.IOS)
92+
{
93+
PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });
94+
95+
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "IOS") });
96+
97+
PublicFrameworks.AddRange(
98+
new string[]
99+
{
100+
"Foundation",
101+
"AuthenticationServices"
102+
}
103+
);
104+
}
105+
106+
if (Target.Platform == UnrealTargetPlatform.Mac)
107+
{
108+
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "Mac") });
109+
110+
PublicFrameworks.AddRange(
111+
new string[]
112+
{
113+
"Foundation",
114+
"AuthenticationServices"
115+
}
116+
);
117+
}
118+
}
119119
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// Fill out your copyright notice in the Description page of Project Settings.
22

3-
43
#include "Immutable/Actions/ImtblBlueprintAsyncAction.h"
54

6-
7-
UImmutableSubsystem* UImtblBlueprintAsyncAction::GetSubsystem() const
8-
{
9-
if (!WorldContextObject || !WorldContextObject->GetWorld())
10-
return nullptr;
11-
return WorldContextObject->GetWorld()->GetGameInstance()->GetSubsystem<UImmutableSubsystem>();
5+
UImmutableSubsystem *UImtblBlueprintAsyncAction::GetSubsystem() const {
6+
if (!WorldContextObject || !WorldContextObject->GetWorld())
7+
return nullptr;
8+
return WorldContextObject->GetWorld()
9+
->GetGameInstance()
10+
->GetSubsystem<UImmutableSubsystem>();
1211
}
13-

0 commit comments

Comments
 (0)