File tree Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code.
5050 CSharp: .cs
5151 Java: .java
5252 JavaScript: .js .mjs .cjs .ts
53- Json: .json
53+ Json: .json .ipynb
5454 Objective-C: .m .mm
5555 Proto: .proto .protodevel
5656 TableGen: .td
Original file line number Diff line number Diff line change @@ -4086,8 +4086,10 @@ static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) {
40864086 return FormatStyle::LK_TableGen;
40874087 if (FileName.ends_with_insensitive (" .cs" ))
40884088 return FormatStyle::LK_CSharp;
4089- if (FileName.ends_with_insensitive (" .json" ))
4089+ if (FileName.ends_with_insensitive (" .json" ) ||
4090+ FileName.ends_with_insensitive (" .ipynb" )) {
40904091 return FormatStyle::LK_Json;
4092+ }
40914093 if (FileName.ends_with_insensitive (" .sv" ) ||
40924094 FileName.ends_with_insensitive (" .svh" ) ||
40934095 FileName.ends_with_insensitive (" .v" ) ||
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ static cl::opt<std::string> AssumeFileName(
8888 " CSharp: .cs\n "
8989 " Java: .java\n "
9090 " JavaScript: .js .mjs .cjs .ts\n "
91- " Json: .json\n "
91+ " Json: .json .ipynb \n "
9292 " Objective-C: .m .mm\n "
9393 " Proto: .proto .protodevel\n "
9494 " TableGen: .td\n "
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def main():
6363 "-iregex" ,
6464 metavar = "PATTERN" ,
6565 default = r".*\.(?:cpp|cc|c\+\+|cxx|cppm|ccm|cxxm|c\+\+m|c|cl|h|hh|hpp"
66- r"|hxx|m|mm|inc|js|ts|proto|protodevel|java|cs|json|s?vh?)" ,
66+ r"|hxx|m|mm|inc|js|ts|proto|protodevel|java|cs|json|ipynb| s?vh?)" ,
6767 help = "custom pattern selecting file paths to reformat "
6868 "(case insensitive, overridden by -regex)" ,
6969 )
Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ def main():
116116 "cjs" , # JavaScript
117117 "ts" , # TypeScript
118118 "cs" , # C Sharp
119- "json" , # Json
119+ "json" ,
120+ "ipynb" , # Json
120121 "sv" ,
121122 "svh" ,
122123 "v" ,
You can’t perform that action at this time.
0 commit comments