-
Notifications
You must be signed in to change notification settings - Fork 581
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
Give birth to the YANGBear #1428
base: master
Are you sure you want to change the base?
Conversation
tests/yang/YANGBearTest.py
Outdated
|
||
VALID = requests.get( | ||
"https://raw.githubusercontent.com/OpenNetworkingFoundation/CENTENNIAL" | ||
"/master/models/yang/core-model.yang" |
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.
You do not use the preferred quotation marks.
QuotesBear, severity NORMAL, section python
.
The issue can be fixed by applying the following patch:
--- a/tests/yang/YANGBearTest.py
+++ b/tests/yang/YANGBearTest.py
@@ -6,7 +6,7 @@
VALID = requests.get(
"https://raw.githubusercontent.com/OpenNetworkingFoundation/CENTENNIAL"
- "/master/models/yang/core-model.yang"
+ '/master/models/yang/core-model.yang'
).text
tests/yang/YANGBearTest.py
Outdated
|
||
|
||
VALID = requests.get( | ||
"https://raw.githubusercontent.com/OpenNetworkingFoundation/CENTENNIAL" |
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.
You do not use the preferred quotation marks.
QuotesBear, severity NORMAL, section python
.
The issue can be fixed by applying the following patch:
--- a/tests/yang/YANGBearTest.py
+++ b/tests/yang/YANGBearTest.py
@@ -5,7 +5,7 @@
VALID = requests.get(
- "https://raw.githubusercontent.com/OpenNetworkingFoundation/CENTENNIAL"
+ 'https://raw.githubusercontent.com/OpenNetworkingFoundation/CENTENNIAL'
"/master/models/yang/core-model.yang"
).text
2cd99e5
to
782fd8f
Compare
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
1 similar comment
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
looks good basically, so why did you mark the PR as WIP? :) |
(sorry btw for not looking at it until now :/ ) |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
3 similar comments
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
@Makman2 I just wanted to add more comprehensive tests and some setting to change the YANG module import search path. But I can also do that in a separate step... |
If you think those tests are okay for a first step, then imo it suffices to get a review, and you can add better tests later 👍 |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
782fd8f
to
591da67
Compare
@Makman2 So please review! :) Meanwhile I also added the new |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
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.
Quite good. I'm a bit worried lxml
might become a dependency, but hopefully not before we're made python deps optional.
tests/yang/YANGBearTest.py
Outdated
from coalib.testing.LocalBearTestHelper import verify_local_bear | ||
|
||
|
||
VALID = requests.get( |
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.
Please store this in our repo, or create simple tests if that file cant be licenced as MIT.
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.
@jayvdb Or I will create a YANG model for coala itself :D Hmm... Let's see!
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.
still open to address
tests/yang/YANGBearTest.py
Outdated
|
||
|
||
# several missing module sub-statements | ||
INVALID = """ |
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.
There will eventually be more than one invalid file. Please give this variable a useful name.
e87a725
to
2548bd7
Compare
2548bd7
to
5841c30
Compare
So... Only tests for new BTW @Makman2 Is this a good setting name? That's a serious question ;) And are there also test helpers for such tasks? |
Looks okay, though what are they used for in |
tests/yang/YANGBearTest.py
Outdated
module coala-model { | ||
|
||
namespace "http://coala.io/yang/coala-model"; | ||
prefix coala; |
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.
These string literals looks ugly....breaks line of flow
Use this https://docs.python.org/2/library/textwrap.html#textwrap.dedent
This is not a compulsory change..It's just a suggestion 😉
Rest LGTM :)
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.
@damngamerz It is compulsory! Believe me ;)
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.
@damngamerz Actually it's compulsory to move them to separate .yang
files! :)
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.
So Im guessing we wont be requiring those string literals...Much better :) 👍
tests/yang/YANGBearTest.py
Outdated
from coalib.testing.LocalBearTestHelper import verify_local_bear | ||
|
||
|
||
COALA_MODEL = """ |
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.
capital C :(
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.
@meetmangukiya Shame on me! ;P
5841c30
to
411142c
Compare
4b1ba67
to
4f96f75
Compare
4f96f75
to
4c3b6c3
Compare
use_stderr=True, | ||
output_format='regex', | ||
output_regex=r'.*:(?P<line>\d+):\s*(?P<message>.*)') | ||
class YANGBear: |
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.
Shouldn't this class derive from some base bear class ?
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.
Not with @linter
;)
Hey, tests are failing, should we drop this out of review queue? |
@Makman2 @userzimmermann This PR is almost complete, with just the window part needed to be handled. |
As new member of https://github.com/OpenNetworkingFoundation I obviously want to add coala code analysis to their repositories :) One of the most important languages there is YANG for data modeling. The new standard for defining network management software functions in future telecommunication infrastructures... But there is no
YANGBear
yet. Well, here it is...It uses https://github.com/mbj4668/pyang for linting
.yang
model files.It only needs a way to configure if also warnings should be complained about or not, and of course more comprehensive tests, to get out of WIP!
Closes #2032
@sils @Makman2