Skip to content

Clean up examples #78

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

Merged
merged 1 commit into from
Feb 20, 2019
Merged

Clean up examples #78

merged 1 commit into from
Feb 20, 2019

Conversation

meskio
Copy link
Contributor

@meskio meskio commented Feb 20, 2019

  • Let's use the pattern 'ok, res = sdclient.operation()'
  • Add python3 support.
  • Clean up some pep8 errors.

This should fix the test errors.

* Let's use the pattern 'ok, res = sdclient.operation()'
* Add python3 support.
* Clean up some pep8 errors.
@meskio
Copy link
Contributor Author

meskio commented Feb 20, 2019

@davideschiera I think I fixed the CI errors, but I'm not sure how to run them to check.

@davideschiera
Copy link
Contributor

Yeah, it's very unfortunate :-(

Let me see if I can run the test suite locally at least...

@davideschiera
Copy link
Contributor

The script seems to be working now.

I see several "prettified" lines. Are you using a linter by any chance? It'd be great to add a basic linting configuration so that everybody could use the same style without worrying much about it. We can discuss this separately from this PR though ;-)

I'll merge the changes. Hopefully no surprises this time! Thanks!

@davideschiera davideschiera merged commit df0bb18 into sysdiglabs:master Feb 20, 2019
@davideschiera
Copy link
Contributor

davideschiera commented Feb 20, 2019

Few were missing:

5ecf304
2563d62
5545ea1
cc76bc9

I think it'd make sense to update all the examples, eg. there are still things like:

#
# Post the event
#
res = sdclient.add_email_notification_recipient(email)

#
# Return the result
#
if res[0]:
    print 'Recipient added successfully'
else:
    print res[1]
    sys.exit(1)

@meskio
Copy link
Contributor Author

meskio commented Feb 21, 2019

For linting I'm using flake8, it gives me warnings on my editor (using vim with ale). Mostly what flake8 does is to highlight pep8 errors. I have disabled few errors (E501,E711,E712,W503) and I try to keep the code out of the others.

How do you envision the linting being integrated? Like some recommendations in the README? Or like some travis linting checks?

I'll open another pull-req fixing the rest of the examples. I have fixed the ones used by the tests, and I didn't notice that was more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants