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

[WIP] Test clang-tidy with selected checks #35

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/awkward/Slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace awkward {
}
virtual const std::string tostring() const;
virtual bool preserves_type(const std::shared_ptr<Type>& type, const Index64& advanced) const {
return type.get() != nullptr && type.get()->numfields() != -1 && util::subset(keys_, type.get()->keys());
return type != nullptr && type.get()->numfields() != -1 && util::subset(keys_, type.get()->keys());
}
private:
const std::vector<std::string> keys_;
Expand Down
64 changes: 32 additions & 32 deletions include/awkward/array/EmptyArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,40 @@ namespace awkward {
EmptyArray(const std::shared_ptr<Identity> id, const std::shared_ptr<Type> type)
: Content(id, type) { }

virtual const std::string classname() const;
virtual void setid();
virtual void setid(const std::shared_ptr<Identity> id);
virtual const std::string tostring_part(const std::string indent, const std::string pre, const std::string post) const;
virtual void tojson_part(ToJson& builder) const;
virtual const std::shared_ptr<Type> innertype(bool bare) const;
virtual void settype_part(const std::shared_ptr<Type> type);
virtual bool accepts(const std::shared_ptr<Type> type);
virtual int64_t length() const;
virtual const std::shared_ptr<Content> shallow_copy() const;
virtual void check_for_iteration() const;
virtual const std::shared_ptr<Content> getitem_nothing() const;
virtual const std::shared_ptr<Content> getitem_at(int64_t at) const;
virtual const std::shared_ptr<Content> getitem_at_nowrap(int64_t at) const;
virtual const std::shared_ptr<Content> getitem_range(int64_t start, int64_t stop) const;
virtual const std::shared_ptr<Content> getitem_range_nowrap(int64_t start, int64_t stop) const;
virtual const std::shared_ptr<Content> getitem_field(const std::string& key) const;
virtual const std::shared_ptr<Content> getitem_fields(const std::vector<std::string>& keys) const;
virtual const std::shared_ptr<Content> carry(const Index64& carry) const;
virtual const std::pair<int64_t, int64_t> minmax_depth() const;
virtual int64_t numfields() const;
virtual int64_t fieldindex(const std::string& key) const;
virtual const std::string key(int64_t fieldindex) const;
virtual bool haskey(const std::string& key) const;
virtual const std::vector<std::string> keyaliases(int64_t fieldindex) const;
virtual const std::vector<std::string> keyaliases(const std::string& key) const;
virtual const std::vector<std::string> keys() const;
const std::string classname() const override;
void setid() override;
void setid(const std::shared_ptr<Identity> id) override;
const std::string tostring_part(const std::string indent, const std::string pre, const std::string post) const override;
void tojson_part(ToJson& builder) const override;
const std::shared_ptr<Type> innertype(bool bare) const override;
void settype_part(const std::shared_ptr<Type> type) override;
bool accepts(const std::shared_ptr<Type> type) override;
int64_t length() const override;
const std::shared_ptr<Content> shallow_copy() const override;
void check_for_iteration() const override;
const std::shared_ptr<Content> getitem_nothing() const override;
const std::shared_ptr<Content> getitem_at(int64_t at) const override;
const std::shared_ptr<Content> getitem_at_nowrap(int64_t at) const override;
const std::shared_ptr<Content> getitem_range(int64_t start, int64_t stop) const override;
const std::shared_ptr<Content> getitem_range_nowrap(int64_t start, int64_t stop) const override;
const std::shared_ptr<Content> getitem_field(const std::string& key) const override;
const std::shared_ptr<Content> getitem_fields(const std::vector<std::string>& keys) const override;
const std::shared_ptr<Content> carry(const Index64& carry) const override;
const std::pair<int64_t, int64_t> minmax_depth() const override;
int64_t numfields() const override;
int64_t fieldindex(const std::string& key) const override;
const std::string key(int64_t fieldindex) const override;
bool haskey(const std::string& key) const override;
const std::vector<std::string> keyaliases(int64_t fieldindex) const override;
const std::vector<std::string> keyaliases(const std::string& key) const override;
const std::vector<std::string> keys() const override;
Copy link
Member

Choose a reason for hiding this comment

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

Replacing virtual with override: okay. I didn't know about that, but it provides some additional safety.


protected:
virtual const std::shared_ptr<Content> getitem_next(const SliceAt& at, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceRange& range, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceArray64& array, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceField& field, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceFields& fields, const Slice& tail, const Index64& advanced) const;
const std::shared_ptr<Content> getitem_next(const SliceAt& at, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceRange& range, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceArray64& array, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceField& field, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceFields& fields, const Slice& tail, const Index64& advanced) const override;
};
}

Expand Down
60 changes: 30 additions & 30 deletions include/awkward/array/ListArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,38 @@ namespace awkward {
const IndexOf<T> stops() const { return stops_; }
const std::shared_ptr<Content> content() const { return content_; }

virtual const std::string classname() const;
virtual void setid();
virtual void setid(const std::shared_ptr<Identity> id);
virtual const std::string tostring_part(const std::string indent, const std::string pre, const std::string post) const;
virtual void tojson_part(ToJson& builder) const;
virtual const std::shared_ptr<Type> innertype(bool bare) const;
virtual void settype_part(const std::shared_ptr<Type> type);
virtual bool accepts(const std::shared_ptr<Type> type);
virtual int64_t length() const;
virtual const std::shared_ptr<Content> shallow_copy() const;
virtual void check_for_iteration() const;
virtual const std::shared_ptr<Content> getitem_nothing() const;
virtual const std::shared_ptr<Content> getitem_at(int64_t at) const;
virtual const std::shared_ptr<Content> getitem_at_nowrap(int64_t at) const;
virtual const std::shared_ptr<Content> getitem_range(int64_t start, int64_t stop) const;
virtual const std::shared_ptr<Content> getitem_range_nowrap(int64_t start, int64_t stop) const;
virtual const std::shared_ptr<Content> getitem_field(const std::string& key) const;
virtual const std::shared_ptr<Content> getitem_fields(const std::vector<std::string>& keys) const;
virtual const std::shared_ptr<Content> carry(const Index64& carry) const;
virtual const std::pair<int64_t, int64_t> minmax_depth() const;
virtual int64_t numfields() const;
virtual int64_t fieldindex(const std::string& key) const;
virtual const std::string key(int64_t fieldindex) const;
virtual bool haskey(const std::string& key) const;
virtual const std::vector<std::string> keyaliases(int64_t fieldindex) const;
virtual const std::vector<std::string> keyaliases(const std::string& key) const;
virtual const std::vector<std::string> keys() const;
const std::string classname() const override;
void setid() override;
void setid(const std::shared_ptr<Identity> id) override;
const std::string tostring_part(const std::string indent, const std::string pre, const std::string post) const override;
void tojson_part(ToJson& builder) const override;
const std::shared_ptr<Type> innertype(bool bare) const override;
void settype_part(const std::shared_ptr<Type> type) override;
bool accepts(const std::shared_ptr<Type> type) override;
int64_t length() const override;
const std::shared_ptr<Content> shallow_copy() const override;
void check_for_iteration() const override;
const std::shared_ptr<Content> getitem_nothing() const override;
const std::shared_ptr<Content> getitem_at(int64_t at) const override;
const std::shared_ptr<Content> getitem_at_nowrap(int64_t at) const override;
const std::shared_ptr<Content> getitem_range(int64_t start, int64_t stop) const override;
const std::shared_ptr<Content> getitem_range_nowrap(int64_t start, int64_t stop) const override;
const std::shared_ptr<Content> getitem_field(const std::string& key) const override;
const std::shared_ptr<Content> getitem_fields(const std::vector<std::string>& keys) const override;
const std::shared_ptr<Content> carry(const Index64& carry) const override;
const std::pair<int64_t, int64_t> minmax_depth() const override;
int64_t numfields() const override;
int64_t fieldindex(const std::string& key) const override;
const std::string key(int64_t fieldindex) const override;
bool haskey(const std::string& key) const override;
const std::vector<std::string> keyaliases(int64_t fieldindex) const override;
const std::vector<std::string> keyaliases(const std::string& key) const override;
const std::vector<std::string> keys() const override;

protected:
virtual const std::shared_ptr<Content> getitem_next(const SliceAt& at, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceRange& range, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceArray64& array, const Slice& tail, const Index64& advanced) const;
const std::shared_ptr<Content> getitem_next(const SliceAt& at, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceRange& range, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceArray64& array, const Slice& tail, const Index64& advanced) const override;

private:
const IndexOf<T> starts_;
Expand Down
60 changes: 30 additions & 30 deletions include/awkward/array/ListOffsetArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,38 @@ namespace awkward {
const IndexOf<T> offsets() const { return offsets_; }
const std::shared_ptr<Content> content() const { return content_; }

virtual const std::string classname() const;
virtual void setid();
virtual void setid(const std::shared_ptr<Identity> id);
virtual const std::string tostring_part(const std::string indent, const std::string pre, const std::string post) const;
virtual void tojson_part(ToJson& builder) const;
virtual const std::shared_ptr<Type> innertype(bool bare) const;
virtual void settype_part(const std::shared_ptr<Type> type);
virtual bool accepts(const std::shared_ptr<Type> type);
virtual int64_t length() const;
virtual const std::shared_ptr<Content> shallow_copy() const;
virtual void check_for_iteration() const;
virtual const std::shared_ptr<Content> getitem_nothing() const;
virtual const std::shared_ptr<Content> getitem_at(int64_t at) const;
virtual const std::shared_ptr<Content> getitem_at_nowrap(int64_t at) const;
virtual const std::shared_ptr<Content> getitem_range(int64_t start, int64_t stop) const;
virtual const std::shared_ptr<Content> getitem_range_nowrap(int64_t start, int64_t stop) const;
virtual const std::shared_ptr<Content> getitem_field(const std::string& key) const;
virtual const std::shared_ptr<Content> getitem_fields(const std::vector<std::string>& keys) const;
virtual const std::shared_ptr<Content> carry(const Index64& carry) const;
virtual const std::pair<int64_t, int64_t> minmax_depth() const;
virtual int64_t numfields() const;
virtual int64_t fieldindex(const std::string& key) const;
virtual const std::string key(int64_t fieldindex) const;
virtual bool haskey(const std::string& key) const;
virtual const std::vector<std::string> keyaliases(int64_t fieldindex) const;
virtual const std::vector<std::string> keyaliases(const std::string& key) const;
virtual const std::vector<std::string> keys() const;
const std::string classname() const override;
void setid() override;
void setid(const std::shared_ptr<Identity> id) override;
const std::string tostring_part(const std::string indent, const std::string pre, const std::string post) const override;
void tojson_part(ToJson& builder) const override;
const std::shared_ptr<Type> innertype(bool bare) const override;
void settype_part(const std::shared_ptr<Type> type) override;
bool accepts(const std::shared_ptr<Type> type) override;
int64_t length() const override;
const std::shared_ptr<Content> shallow_copy() const override;
void check_for_iteration() const override;
const std::shared_ptr<Content> getitem_nothing() const override;
const std::shared_ptr<Content> getitem_at(int64_t at) const override;
const std::shared_ptr<Content> getitem_at_nowrap(int64_t at) const override;
const std::shared_ptr<Content> getitem_range(int64_t start, int64_t stop) const override;
const std::shared_ptr<Content> getitem_range_nowrap(int64_t start, int64_t stop) const override;
const std::shared_ptr<Content> getitem_field(const std::string& key) const override;
const std::shared_ptr<Content> getitem_fields(const std::vector<std::string>& keys) const override;
const std::shared_ptr<Content> carry(const Index64& carry) const override;
const std::pair<int64_t, int64_t> minmax_depth() const override;
int64_t numfields() const override;
int64_t fieldindex(const std::string& key) const override;
const std::string key(int64_t fieldindex) const override;
bool haskey(const std::string& key) const override;
const std::vector<std::string> keyaliases(int64_t fieldindex) const override;
const std::vector<std::string> keyaliases(const std::string& key) const override;
const std::vector<std::string> keys() const override;

protected:
virtual const std::shared_ptr<Content> getitem_next(const SliceAt& at, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceRange& range, const Slice& tail, const Index64& advanced) const;
virtual const std::shared_ptr<Content> getitem_next(const SliceArray64& array, const Slice& tail, const Index64& advanced) const;
const std::shared_ptr<Content> getitem_next(const SliceAt& at, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceRange& range, const Slice& tail, const Index64& advanced) const override;
const std::shared_ptr<Content> getitem_next(const SliceArray64& array, const Slice& tail, const Index64& advanced) const override;

private:
const IndexOf<T> offsets_;
Expand Down
Loading