Skip to content
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/508 for code review #554

Merged
merged 7 commits into from
Jul 23, 2014
Merged

Fix/508 for code review #554

merged 7 commits into from
Jul 23, 2014

Conversation

iglpdc
Copy link
Contributor

@iglpdc iglpdc commented Jul 22, 2014

I have a first version of the code. I've made a new base class for khmer exceptions that derives from std::exception.

A couple of things, though:

  • I think the exceptions defined in khmer.hh should be moved to the new file khmer_exceptions.hh.
  • when grepping the cc files for std::exception, a few functions throw std::exception's instead of khmer derived exceptions. I think this should be changed in most cases.

@ged-jenkins
Copy link

Can one of the admins verify this patch?

1 similar comment
@ged-jenkins
Copy link

Can one of the admins verify this patch?

@mr-c
Copy link
Contributor

mr-c commented Jul 22, 2014

ok to test

@mr-c
Copy link
Contributor

mr-c commented Jul 22, 2014

@iglpdc This looks great. I agree about the other std::exceptions, they need to be changed

@mr-c
Copy link
Contributor

mr-c commented Jul 22, 2014

I'm also +1 for consolidating all the exceptions into this new file

@ctb
Copy link
Member

ctb commented Jul 23, 2014

I'm OK with EITHER merging this first, OR waiting for @iglpdc to do more work :). Which would you prefer, Ivan?

@iglpdc
Copy link
Contributor Author

iglpdc commented Jul 23, 2014

I can move all the exceptions to this new file. I can try to change all the throw std::exception()in the code to the new khmer::exception. We can merge after that.

@ctb
Copy link
Member

ctb commented Jul 23, 2014

On Wed, Jul 23, 2014 at 07:49:21AM -0700, Ivan Gonzalez wrote:

I can move all the exceptions to this new file. I can try to change all the throw std::exception()in the code to the new khmer::exception. We can merge after that.

👍

@iglpdc
Copy link
Contributor Author

iglpdc commented Jul 23, 2014

I've moved all the exceptions defined in khmer.hh to the new file khmer_exceptions.hhand made changes so the code throws only khmer::khmer_exception or its derived classes. Probably, in some cases it's still too generic, but I don't know the code enough to introduce new exceptions :-).

In any case, take a look.

@ctb
Copy link
Member

ctb commented Jul 23, 2014

LGTM! Can you paste in the checklist and check off as many of the boxes as possible?

@iglpdc
Copy link
Contributor Author

iglpdc commented Jul 23, 2014

  • Is it mergable
  • Did it pass the tests?
  • If it introduces new functionality in scripts/ is it tested?
    Check for code coverage.
  • Is it well formatted? Look at pep8/pylint, cppcheck, and
    make doc output. Use autopep8 and astyle -A10 --max-code-length=80
    if needed.
  • Is it documented in the Changelog?
  • Was spellcheck run on the source code and documentation after changes
    were made

@@ -1,3 +1,10 @@
2014-07-24 Ivan Gonzalez <iglpdc@gmail.com>

* All exceptions are now derived from a new base class exception,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be tedious, but we list every file modified in our changelog entries (see below)

@@ -60,6 +58,7 @@ __attribute__((cpychecker_type_object_for_typedef(typename)))
# define MIN( a, b ) (((a) > (b)) ? (b) : (a))
# define MAX( a, b ) (((a) < (b)) ? (b) : (a))

#include "khmer_exception.hh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Includes should all be at the top together

@mr-c
Copy link
Contributor

mr-c commented Jul 23, 2014

@iglpdc This is great, thanks! Fix the comments and I'll merge

@iglpdc
Copy link
Contributor Author

iglpdc commented Jul 23, 2014

Just moved the include's altogether.

@mr-c mr-c merged commit 1c8e027 into dib-lab:master Jul 23, 2014
@mr-c
Copy link
Contributor

mr-c commented Jul 23, 2014

@iglpdc Congratulations on your first commit to the khmer project! Your name will be included in the release notes for the next version and you'll be listed amongst our other contributors in the next software release paper.

@ged-jenkins
Copy link

Can one of the admins verify this patch?

1 similar comment
@ged-jenkins
Copy link

Can one of the admins verify this patch?

@iglpdc
Copy link
Contributor Author

iglpdc commented Jul 24, 2014

Awesome!

Ivan

El 23/07/2014, a las 23:00, "Michael R. Crusoe" notifications@github.com escribió:

@iglpdc Congratulations on your first commit to the khmer project! Your name will be included in the release notes for the next version and you'll be listed amongst our other contributors in the next software release paper.


Reply to this email directly or view it on GitHub.

@mr-c mr-c added this to the 1.2 Release milestone Sep 2, 2014
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.

4 participants