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

EVA-470 Summary report independent from checks #52

Merged
merged 5 commits into from
Oct 17, 2016

Conversation

jmmut
Copy link
Contributor

@jmmut jmmut commented Oct 12, 2016

Allow filtering superfluous warnings when writing to standard output.

The checks are always done and always raised, but only reported in non-summary reports.
The previous behaviour was that if the error was already raised, it was not raised for any report type.

Copy link
Contributor

@cyenyxe cyenyxe left a comment

Choose a reason for hiding this comment

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

We may need to reconsider how we write reports to different streams, output files, etc.

friend class odb::access;
NoMetaDefinitionError() {}
public:
NoMetaDefinitionError(size_t line, std::string message, std::string column, std::string field)
Copy link
Contributor

Choose a reason for hiding this comment

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

Other classes in the hierarchy use const std::string & as string arguments for the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in next commit

public:
virtual void write_error(Error &error)
{
std::cout << error.what() << std::endl;
Copy link
Contributor

@cyenyxe cyenyxe Oct 12, 2016

Choose a reason for hiding this comment

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

This will conflict with the plain text report, because they both write to stdout: https://github.com/jmmut/vcf-validator/blob/76ad342fc2cb16af51aa2d91fc464a7bd1354060/inc/vcf/report_writer.hpp#L42

Copy link
Contributor Author

Choose a reason for hiding this comment

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

complete report removed, so now only the summary report writes to stdout

@jmmut jmmut force-pushed the feature/repeated-report branch from 22be434 to fc73153 Compare October 13, 2016 09:47
#pragma db object
struct NoMetaDefinitionError : public Error
{
private:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the private block be moved to the end of the class declaration, as in Error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in next commit

bool is_already_reported(std::string const &meta_type, std::string const &id) const
{
typedef std::multimap<std::string,std::string>::const_iterator iter;
std::pair<iter, iter> range = undefined_metadata.equal_range(meta_type);
Copy link
Contributor

Choose a reason for hiding this comment

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

undefined_metadata should be renamed to reflect is stores already reported errors, as the methods already do properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in next commit

class SummaryReportWriter : public ReportWriter
{
public:
SummaryReportWriter(std::ostream &out) : out(out) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

out{out}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in next commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted, it breaks gcc 4.8 compilation

@@ -196,7 +197,7 @@ namespace
}
outputs.emplace_back(new ebi::vcf::OdbReportRW(db_filename));
} else if (out == "stdout") {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could call the report types "complete" / "full" (I think "full" is the most frequent term) and "summary", instead of "database" and "stdout".

Copy link
Contributor Author

@jmmut jmmut Oct 17, 2016

Choose a reason for hiding this comment

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

the problem with that is that the reports are written in different ways, the database one only writes to a file, while the stdout only writes to stdout, unless you redirect manually to a file. I we change the name to "full" and "summary" I would change the behaviour of "summary" to not write to stdout, but directly to a file, just as "full" does currently.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed to think a bit more about this and make a decision in the short term.

@@ -33,6 +33,8 @@ namespace ebi
return std::shared_ptr<Error>(new HeaderSectionError{line, message});
case ErrorCode::body_section:
return std::shared_ptr<Error>(new BodySectionError{line, message});
case ErrorCode::no_meta_definition:
Copy link
Contributor

Choose a reason for hiding this comment

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

For another PR, but this get_error_instance function is only used by the SqliteReport so we should get rid of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@jmmut jmmut force-pushed the feature/repeated-report branch from 6fd8999 to 8ca88b6 Compare October 17, 2016 10:42
@cyenyxe cyenyxe merged commit d9c1031 into EBIvariation:develop Oct 17, 2016
@jmmut jmmut deleted the feature/repeated-report branch October 21, 2016 12:37
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