Skip to content

Commit

Permalink
Update ruff and clang-format versions (#21479)
Browse files Browse the repository at this point in the history
ruff -> 0.5.4
clang-format -> 18
  • Loading branch information
justinchuby authored Jul 24, 2024
1 parent eb9b377 commit c203d89
Show file tree
Hide file tree
Showing 152 changed files with 3,781 additions and 3,842 deletions.
2 changes: 1 addition & 1 deletion cgmanifests/generate_cgmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def add_github_dep(name, parsed_url):
return
# Make a REST call to convert to tag to a git commit
url = f"https://api.github.com/repos/{org_name}/{repo_name}/git/refs/tags/{tag}"
print("requesting %s ..." % url)
print("requesting {url} ...")
res = requests.get(url, auth=(args.username, args.token))
response_json = res.json()
tag_object = response_json["object"]
Expand Down
2 changes: 1 addition & 1 deletion csharp/tools/ValidateNativeDelegateAttributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def check_all_delegates_have_unmanaged_function_pointer_attribute(file: pathlib.
line_num = 0
with open(str(file.resolve(strict=True))) as f:
prev_line = ""
for line in f.readlines():
for line in f:
line_num += 1

# strip so it's easier to deal with commented out lines.
Expand Down
6 changes: 3 additions & 3 deletions include/onnxruntime/core/common/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ namespace onnxruntime {

class NotImplementedException : public std::logic_error {
public:
explicit NotImplementedException(const char* _Message = "Function not yet implemented") noexcept : std::logic_error(_Message){};
explicit NotImplementedException(const std::string& _Message = "Function not yet implemented") noexcept : std::logic_error(_Message){};
explicit NotImplementedException(const char* _Message = "Function not yet implemented") noexcept : std::logic_error(_Message) {};
explicit NotImplementedException(const std::string& _Message = "Function not yet implemented") noexcept : std::logic_error(_Message) {};
};

class TypeMismatchException : public std::logic_error {
public:
TypeMismatchException() noexcept : logic_error("Type mismatch"){};
TypeMismatchException() noexcept : logic_error("Type mismatch") {};
};

class OnnxRuntimeException : public std::exception {
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/stream_handles.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Stream {
return {};
};
// block the host thread until all the tasks in the stream finished.
virtual void Flush(){};
virtual void Flush() {};
// The framework may reuse the stream instance for multiple iterations.
// This is the API that provide a chance to let the device stream cleanup
// resource at the end of a iteration.
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/platform/Barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ class Barrier {
// Multiple threads can wait on the same Notification object,
// but only one caller must call Notify() on the object.
struct Notification : Barrier {
Notification() : Barrier(1){};
Notification() : Barrier(1) {};
};
} // namespace onnxruntime
10 changes: 5 additions & 5 deletions include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,18 @@ class ThreadPoolProfiler {
WAIT_REVOKE,
MAX_EVENT
};
ThreadPoolProfiler(int, const CHAR_TYPE*){};
ThreadPoolProfiler(int, const CHAR_TYPE*) {};
~ThreadPoolProfiler() = default;
ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(ThreadPoolProfiler);
void Start(){};
void Start() {};
std::string Stop() { return "not available for minimal build"; }
void LogStart(){};
void LogStart() {};
void LogEnd(ThreadPoolEvent){};
void LogEndAndStart(ThreadPoolEvent){};
void LogStartAndCoreAndBlock(std::ptrdiff_t){};
void LogCoreAndBlock(std::ptrdiff_t){};
void LogThreadId(int){};
void LogRun(int){};
void LogThreadId(int) {};
void LogRun(int) {};
std::string DumpChildThreadStat() { return {}; }
};
#else
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/providers/custom_op_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// CustomOpContext defines an interface allowing a custom op to access ep-specific resources.
struct CustomOpContext {
CustomOpContext() = default;
virtual ~CustomOpContext(){};
virtual ~CustomOpContext() {};
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace Experimental {

struct Session : Ort::Session {
Session(Env& env, std::basic_string<ORTCHAR_T>& model_path, SessionOptions& options)
: Ort::Session(env, model_path.data(), options){};
: Ort::Session(env, model_path.data(), options) {};
Session(Env& env, void* model_data, size_t model_data_length, SessionOptions& options)
: Ort::Session(env, model_data, model_data_length, options){};
: Ort::Session(env, model_data, model_data_length, options) {};

// overloaded Run() with sensible defaults
std::vector<Ort::Value> Run(const std::vector<std::string>& input_names,
Expand All @@ -52,7 +52,7 @@ struct Session : Ort::Session {

struct Value : Ort::Value {
Value(OrtValue* p)
: Ort::Value(p){};
: Ort::Value(p) {};

template <typename T>
static Ort::Value CreateTensor(T* p_data, size_t p_data_element_count, const std::vector<int64_t>& shape);
Expand Down
4 changes: 2 additions & 2 deletions include/onnxruntime/core/session/onnxruntime_cxx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2175,8 +2175,8 @@ struct Op : detail::Base<OrtOp> {
/// </summary>
struct ShapeInferContext {
struct SymbolicInteger {
SymbolicInteger(int64_t i) : i_(i), is_int_(true){};
SymbolicInteger(const char* s) : s_(s), is_int_(false){};
SymbolicInteger(int64_t i) : i_(i), is_int_(true) {};
SymbolicInteger(const char* s) : s_(s), is_int_(false) {};
SymbolicInteger(const SymbolicInteger&) = default;
SymbolicInteger(SymbolicInteger&&) = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ArgBase {
ArgBase(OrtKernelContext* ctx,
size_t indice,
bool is_input) : ctx_(ctx), indice_(indice), is_input_(is_input) {}
virtual ~ArgBase(){};
virtual ~ArgBase() {};

protected:
struct KernelContext ctx_;
Expand Down
Loading

0 comments on commit c203d89

Please sign in to comment.