-
Couldn't load subscription status.
- Fork 0
Unity Lint Test #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unity Lint Test #187
Changes from all commits
8cba830
46df322
0e4d747
6bc52a2
b25274c
a937c33
05cba49
a64921e
974ff39
5000512
65e30af
2f40b41
15ff281
9f96836
37c278a
12131fe
c0d3f9b
5072461
983f3ab
9ffeac4
3de996b
2217e2b
ca8d4e8
dc5e24a
dac7123
2820ac5
668e0ce
270c825
e6eeeb2
f98ee32
cee7642
8c6350b
289e0a8
5845941
98fde76
46a37b9
6756994
09dd9bd
fa2dba2
add0426
3f7ebc9
0a69fa2
04be864
80569db
3346bed
09f1dc9
977fb43
7754f0a
ba9518e
52476d6
5c462f4
8ca9818
db39994
3a27b55
c3513db
b8b67f5
a9e8bcf
55faa15
a1a4e06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
|
|
||
| using UnityEngine; | ||
|
|
||
| namespace CodeStyleExample | ||
| { | ||
| // クラス名はPascalCaseが推奨されているが、lowercase名を使った例(スタイル違反) | ||
| public class FileNameIssueStyleViolationTest | ||
| { | ||
| // メンバー変数の命名規則違反(推奨: _camelCase または PascalCase) | ||
| private int TestVariable = 10; | ||
|
|
||
| // 正しい名前のフィールド | ||
| private string _exampleField = "Valid"; | ||
|
|
||
| // Staticメンバー配置順序の違反(推奨: 静的要素 → インスタンスメンバーの順序) | ||
| public static readonly string StaticExample = "Static Value"; | ||
|
|
||
| // メソッド名の命名規則違反(PascalCaseが推奨される) | ||
| public void printmessage() // 【違反】PascalCaseでない | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [StyleCop] reported by reviewdog 🐶 |
||
| { | ||
| Debug.Log("This should follow PascalCase."); | ||
| } | ||
|
|
||
| // 正しいメソッド | ||
| public void DisplayMessage() | ||
| { | ||
| Debug.Log(_exampleField); | ||
| } | ||
|
|
||
| // if文に波括弧{}が無い(スタイル違反: IDE0011) | ||
| public void CheckCondition(int value) | ||
| { | ||
| if (value > 0) // 【違反】波括弧が無い | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Debug.Log("Value is positive."); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| // 正しい条件分岐 | ||
| public void CorrectConditionCheck(int value) | ||
| { | ||
| if (value > 0) | ||
| { | ||
| Debug.Log("Value is positive."); | ||
| } | ||
| } | ||
|
|
||
| // プロパティ定義ではPascalCaseが推奨 | ||
| public int myProperty { get; set; } = 42; // 【違反】PascalCaseでない名前 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [StyleCop] reported by reviewdog 🐶 |
||
|
|
||
| // 正しいプロパティ定義 | ||
| public int MyProperty { get; set; } = 100; | ||
|
|
||
| // 最後に改行がない(スタイル違反: `insert_final_newline=true`) | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| namespace Tests.StyleTest | ||
| { | ||
| public sealed class StyleTest2 | ||
| { | ||
| static string s_staticField = string.Empty; | ||
| string test; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [StyleCop] reported by reviewdog 🐶 |
||
| string _test2; | ||
|
|
||
| void Test() | ||
| { | ||
| var test = this._test2; | ||
|
|
||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| namespace Tests.StyleTest | ||
| { | ||
| public sealed class StyleTest3 | ||
| { | ||
| public static readonly string TestStaticReadonly = "TestStaticReadonly"; | ||
| static string s_staticField = string.Empty; | ||
| string _test; | ||
| string _test2; | ||
|
|
||
| void Test() | ||
| { | ||
| } | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| namespace Tests.StyleTest | ||
| { | ||
| public sealed class StyleTest4 | ||
| { | ||
| static string s_staticField = string.Empty; | ||
| string _test; | ||
| string _test2; | ||
|
|
||
| void Test() | ||
| { | ||
| var test = this._test2; | ||
|
|
||
| } | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [StyleCop] reported by reviewdog 🐶
Naming rule violation: Missing prefix: '_'