Skip to content

Commit 0c8cb69

Browse files
authored
feat: basic ipython support (#353)
1 parent a4d22eb commit 0c8cb69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1738
-514
lines changed

crates/cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ uuid = { version = "1.1", features = ["v4", "serde"] }
2626
tokio = { version = "1", features = ["full"] }
2727
chrono = { version = "0.4.26", features = ["serde"] }
2828
reqwest = { version = "0.11", features = ["json", "stream"] }
29-
futures-util = "0.3.30"
29+
futures-util = { version = "0.3.30" }
3030
lazy_static = { version = "1.4.0" }
3131
indicatif-log-bridge = { version = "0.2.1" }
3232
colored = { version = "2.0.4" }

crates/cli/src/commands/patterns_list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use marzano_gritmodule::config::{DefinitionSource, ResolvedGritDefinition};
55
use crate::{
66
flags::GlobalFormatFlags,
77
lister::{list_applyables, Listable},
8-
resolver::{resolve_from_flags_or_cwd},
8+
resolver::resolve_from_flags_or_cwd,
99
};
1010

1111
use super::list::ListArgs;

crates/cli/src/github.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::analyze::group_checks;
22
use crate::ux::CheckResult;
33
use anyhow::{Context as _, Result};
4+
use fs_err::OpenOptions;
45
use grit_util::Range;
56
use log::info;
67
use marzano_core::{api::EnforcementLevel, fs::extract_ranges};
78
use marzano_gritmodule::config::ResolvedGritDefinition;
89
use marzano_gritmodule::utils::extract_path;
9-
use fs_err::OpenOptions;
1010
use std::io::prelude::*;
1111

1212
fn format_level(level: &EnforcementLevel) -> String {

crates/cli/src/result_formatting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use anyhow::anyhow;
22
use colored::Colorize;
33
use console::style;
44
use core::fmt;
5+
use fs_err::read_to_string;
56
use log::info;
67
use marzano_core::api::{
78
AllDone, AnalysisLog, CreateFile, DoneFile, FileMatchResult, InputFile, Match, MatchResult,
@@ -10,7 +11,6 @@ use marzano_core::api::{
1011
use marzano_core::constants::DEFAULT_FILE_NAME;
1112
use marzano_messenger::output_mode::OutputMode;
1213
use std::fmt::Display;
13-
use fs_err::read_to_string;
1414
use std::{
1515
io::Write,
1616
sync::{Arc, Mutex},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "5e3cb542-933d-4bf3-a82b-d9d6395a7832",
7+
"metadata": {
8+
"tags": []
9+
},
10+
"outputs": [],
11+
"source": ["print(4)\n", "print(\"3\")\n", "print(5)"]
12+
}
13+
],
14+
"metadata": {
15+
"kernelspec": {
16+
"display_name": "conda210",
17+
"language": "python",
18+
"name": "conda210"
19+
},
20+
"language_info": {
21+
"codemirror_mode": {
22+
"name": "ipython",
23+
"version": 3
24+
},
25+
"file_extension": ".py",
26+
"mimetype": "text/x-python",
27+
"name": "python",
28+
"nbconvert_exporter": "python",
29+
"pygments_lexer": "ipython3",
30+
"version": "3.9.16"
31+
}
32+
},
33+
"nbformat": 2,
34+
"nbformat_minor": 5
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "5e3cb542-933d-4bf3-a82b-d9d6395a7832",
7+
"metadata": {
8+
"tags": []
9+
},
10+
"outputs": [],
11+
"source": [
12+
"import configparser\n",
13+
"\n",
14+
"config = configparser.ConfigParser()\n",
15+
"config.read(\"./secrets.ini\")"
16+
]
17+
}
18+
],
19+
"metadata": {
20+
"kernelspec": {
21+
"display_name": "conda210",
22+
"language": "python",
23+
"name": "conda210"
24+
},
25+
"language_info": {
26+
"codemirror_mode": {
27+
"name": "ipython",
28+
"version": 3
29+
},
30+
"file_extension": ".py",
31+
"mimetype": "text/x-python",
32+
"name": "python",
33+
"nbconvert_exporter": "python",
34+
"pygments_lexer": "ipython3",
35+
"version": "3.9.16"
36+
}
37+
},
38+
"nbformat": 4,
39+
"nbformat_minor": 5
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language python
2+
3+
or {
4+
// Simple replacement
5+
`configparser.ConfigParser()` => `FigParser.Fig()`,
6+
// Cross-cell references
7+
`Tool($args)` => `Fool($args)` where {
8+
$program <: contains `from langchain.agents import $_`
9+
},
10+
`print($x)` => `flint($x)`
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "5e3cb542-933d-4bf3-a82b-d9d6395a7832",
7+
"metadata": {
8+
"tags": []
9+
},
10+
"outputs": [],
11+
"source": [
12+
"print(4)\n",
13+
"print(\"3\")\n",
14+
"print(5)"
15+
]
16+
}
17+
],
18+
"metadata": {
19+
"kernelspec": {
20+
"display_name": "conda210",
21+
"language": "python",
22+
"name": "conda210"
23+
},
24+
"language_info": {
25+
"codemirror_mode": {
26+
"name": "ipython",
27+
"version": 3
28+
},
29+
"file_extension": ".py",
30+
"mimetype": "text/x-python",
31+
"name": "python",
32+
"nbconvert_exporter": "python",
33+
"pygments_lexer": "ipython3",
34+
"version": "3.9.16"
35+
}
36+
},
37+
"nbformat": 4,
38+
"nbformat_minor": 5
39+
}

0 commit comments

Comments
 (0)