-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix final and abstract access modifiers #34
Conversation
Hey kdorsel, Thanks you very much for the PR. I'll have look at it tomorrow. Roald |
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.
Can you also add some tests to the TcBlackTests project in ObjectDefinitionTests.cs
? Perhaps best to collect the tests in a new method, something like AbstractAndFinalModifiersForMethodsAndFunctionBlocks
src/TcBlack/ObjectDefinition.cs
Outdated
@@ -138,7 +153,7 @@ private TcObject TokenizeFunctionBlock() | |||
private TcObject TokenizeMethodOrProperty() | |||
{ | |||
string entityType = @"\s*(FUNCTION|METHOD|PROPERTY)\s*"; | |||
string accessModifier = @"(PRIVATE|PUBLIC|PROTECTED|INTERNAL)?\s*"; | |||
string accessModifier = @"(PRIVATE|PUBLIC|PROTECTED|INTERNAL|FINAL|ABSTRACT)?\s*"; |
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.
string accessModifier = @"(PRIVATE|PUBLIC|PROTECTED|INTERNAL|FINAL|ABSTRACT)?\s*"; | |
string accessModifier = | |
@"(PRIVATE|PUBLIC|PROTECTED|INTERNAL|FINAL|ABSTRACT)?\s*"; |
I'm trying to also maintain the 88 line length limit in the code itself. See for more info https://github.com/Roald87/TcBlack/blob/master/CONTRIBUTING.md#use-a-consistent-coding-style
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.
Sure, is there a C# Black that can be added to the project?
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.
I haven't found a free one unfortunately. There is https://www.jetbrains.com/resharper/, but you have to pay for that one.
I'll create a test suite for these. |
I'm having troubles with loading the test project with this error:
Comparing the TcBlack and TcBlackTests csproj they are completely different. I'm using VS2015. |
I haven't tried to run the project with VS2015. In the contributing https://github.com/Roald87/TcBlack/blob/master/CONTRIBUTING.md#use-a-consistent-coding-style document I recommend to use VS2017. Is that an issue for you? The fact that they are so different is an artifact from the past. I initially stared the project using .NET Core. Later I converted to the .NET Framework. Apparently I didn't convert the unit test project. I'll have a look if I can convert the unit test project as well. |
I need VS2015 since TC3 Database Server doesn't work on VS2017 yet. I can get VS2017 also, but beside that file I haven't had any issues. |
Ok let me try to change it. As long as you don't upload the |
Does the test in this branch run? https://github.com/Roald87/TcBlack/tree/xunit-in-net-framework |
The UnitTestDotNetFramework project loads and I can access it. But when I Run All Tests I get no results and it looks like no tests are run. I'll look more into it. I'll also get VS2017 and try and report back. https://xunit.net/docs/getting-started/netfx/visual-studio |
Is was some option under Tests > General I believe which you have to disable. It was something with optimization blabla. You should turn that off, then it worked for me. |
In VS2017, everything works fine from the main branch (TcBlackTests). I'll work on adding the tests now for this. Sorry for adding the extra work! The xunit-in-net-framework branch is no longer needed. |
No problem. I didn't want to scare away the first contributor 😛 . |
Updated with tests and also closes #36 now. |
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.
It looks very good!
It only fails when I add more than one space between PUBLIC/PRIVATE...
and ABSTRACT
or FINAL
. So for example the following test fails
[InlineData(
"METHOD PROTECTED FINAL Sum : BOOL",
"METHOD PROTECTED FINAL Sum : BOOL"
)]
Can you try to also catch this case?
Thank you very much for your contribution! |
Fix for abstract and final access modifiers for FB and methods
Fixes #32 #36