Project

General

Profile

Actions

Task #3836

open

Formatting rust code

Added by Roland Fischer over 4 years ago. Updated 10 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

Side-discussion on clang-formatting code, see #3736

We shall rustfmt rust code.
We shall add a rustfmt check to the build similar to the formatting-check with clang-format that checks a branch' rust changes for correct formatting.


Related issues 1 (1 open0 closed)

Related to Suricata - Task #3166: src code file reorgIn ProgressJason IshActions
Actions #1

Updated by Roland Fischer over 4 years ago

clang-format checks only work on actual code changes using git-clang-format.

It does not seem that rustfmt supports that functionality yet (or that there is an equivalent a la git-rustfmt).

@jasonish:

Unfortunately I don't think rustfmt is advanced enough in this area. From what I can tell its the complete file or nothing, and being able to just look at the changed lines is still an open issue:

rust-lang/rustfmt#4103
rust-lang/rustfmt#1324

Actions #2

Updated by Roland Fischer over 4 years ago

Note, if all of the rust code was already properly formatted, one could just run rustfmt over the whole branch instead of just the changes.

However, that begs the question similar to the C code. Do you want to reformat all rust code in one go? Would probably require some discussion.

Actions #4

Updated by Philippe Antoine over 1 year ago

  • Target version set to 8.0.0-beta1
Actions #5

Updated by Philippe Antoine over 1 year ago

  • Assignee set to OISF Dev
Actions #6

Updated by Philippe Antoine over 1 year ago

  • Assignee changed from OISF Dev to Philippe Antoine
Actions #7

Updated by Philippe Antoine about 1 year ago

  • Status changed from New to In Review
Actions #8

Updated by Philippe Antoine 10 months ago

https://github.com/OISF/suricata/pull/10303 is the latest version, easy to recreate the formatting commit

Actions #9

Updated by Jason Ish 10 months ago

  • Status changed from In Review to In Progress
  • Assignee changed from Philippe Antoine to Jason Ish

Taking over, and relating to the source file re-org, as we'll do it all together.

Actions #10

Updated by Jason Ish 10 months ago

  • Related to Task #3166: src code file reorg added
Actions

Also available in: Atom PDF