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

Add CSpell #682

Merged
merged 119 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
a07d246
add cspell.json
kevaundray Jan 21, 2023
3939bfb
add cspell to CI
kevaundray Jan 21, 2023
cca01db
include rs, ts, js
kevaundray Jan 21, 2023
957bf5c
change root directory
kevaundray Jan 21, 2023
51418ca
remove contrain:
kevaundray Jan 22, 2023
4049806
ci : scan all files not just changed ones for this PR
kevaundray Jan 22, 2023
0da2a43
update cspell.json
kevaundray Jan 22, 2023
d0320ce
Push spelling mistakes to the top of the file
kevaundray Jan 22, 2023
2841ce4
Merge branch 'master' into kw/add-cspell
kevaundray Jan 30, 2023
081b204
Merge remote-tracking branch 'origin/master' into kw/add-cspell
kevaundray Feb 2, 2023
1173ed6
analyse(d) -> analyze(d)
kevaundray Feb 2, 2023
e45ab79
monomorphis -> monomorphiz
kevaundray Feb 2, 2023
55fd09f
optimis -> optimiz
kevaundray Feb 2, 2023
efcdbff
serialis -> serializ
kevaundray Feb 2, 2023
48cac36
usefull -> useful
kevaundray Feb 2, 2023
fd1e004
perfom -> perform
kevaundray Feb 2, 2023
9305425
occurences -> occurrences
kevaundray Feb 2, 2023
a2e6b13
puposes -> purposes
kevaundray Feb 2, 2023
9f629d0
flattenning -> flattening
kevaundray Feb 2, 2023
934434d
adress -> address
kevaundray Feb 2, 2023
fe66b0f
lenghts -> lengths
kevaundray Feb 2, 2023
e7dac2c
conresponding -> corresponding
kevaundray Feb 2, 2023
d6bc8dd
initialis -> initializ
kevaundray Feb 2, 2023
321cf7b
occured -> occurred
kevaundray Feb 2, 2023
2d0bf11
contrain -> constrain
kevaundray Feb 2, 2023
82d5fa0
Oshoud -> fix comment
kevaundray Feb 2, 2023
c1bd842
concatened -> concatenated
kevaundray Feb 2, 2023
d2d6961
assuption -> assumption
kevaundray Feb 2, 2023
0579178
circtuit -> circuit
kevaundray Feb 2, 2023
360edd2
synchronise -> synchronize
kevaundray Feb 2, 2023
2334469
conditionalise -> conditionalize
kevaundray Feb 2, 2023
69542f7
arbitraty -> arbitrary
kevaundray Feb 2, 2023
671b088
flatened -> flattened
kevaundray Feb 2, 2023
ef5a162
charac -> (fix comment)
kevaundray Feb 2, 2023
b46943a
insterted -> inserted
kevaundray Feb 2, 2023
03b7675
statment -> statement
kevaundray Feb 2, 2023
8ebf334
recursiverly -> recursively
kevaundray Feb 2, 2023
26e4c5f
recognise -> recognize
kevaundray Feb 2, 2023
9063373
normalisation -> normalization
kevaundray Feb 2, 2023
81662a6
dont -> don't
kevaundray Feb 2, 2023
90c6c92
secp -> secp256k1
kevaundray Feb 2, 2023
3ec7df8
dunmmy -> dummy
kevaundray Feb 2, 2023
75b8a69
erce -> (Fix comment)
kevaundray Feb 2, 2023
ca1d7a1
utilise -> utilize
kevaundray Feb 2, 2023
80e3cab
grammer -> grammar
kevaundray Feb 2, 2023
758826a
messsages -> messages
kevaundray Feb 2, 2023
2bd0df5
Chidren -> Children
kevaundray Feb 2, 2023
d565ffb
Opportunties -> Opportunities
kevaundray Feb 2, 2023
373554d
sanitisation -> sanitization
kevaundray Feb 2, 2023
62d46d6
ellide -> elide
kevaundray Feb 2, 2023
c042c10
interner -> Add brief comment
kevaundray Feb 2, 2023
784c13b
callsite -> "call site"
kevaundray Feb 2, 2023
815315f
cspell -- remove capitalisations (this does not matter for spelling)
kevaundray Feb 2, 2023
2c33963
bitsize -> "bit size"
kevaundray Feb 2, 2023
4537a19
optype -> op_type
kevaundray Feb 2, 2023
9dbfae0
lowlevel -> low level
kevaundray Feb 2, 2023
020b537
otype -> "object type"
kevaundray Feb 2, 2023
5c2f054
coef_ -> coeff_
kevaundray Feb 2, 2023
54d40d2
coef -> coeff
kevaundray Feb 2, 2023
197cd28
flatenning -> flattening
kevaundray Feb 2, 2023
5407b16
typevariable -> "type variable"
kevaundray Feb 2, 2023
76ae219
funcid -> "func id"
kevaundray Feb 2, 2023
874fbf3
ssafunc -> "ssa func"
kevaundray Feb 2, 2023
1fa5d15
add todo for optim
kevaundray Feb 2, 2023
4df325d
notequal -> "not equal"
kevaundray Feb 2, 2023
4c67698
constrain -> (remove)
kevaundray Feb 2, 2023
98e5c5b
bsize -> "bit size"
kevaundray Feb 2, 2023
fbf89fd
eucl -> euclidean
kevaundray Feb 2, 2023
4132c15
shortfield -> "short field"
kevaundray Feb 3, 2023
d42667b
longfield -> "long field"
kevaundray Feb 3, 2023
3eccf1e
"myfunc" -> "my_func"
kevaundray Feb 3, 2023
fe53f4b
arithematic -> arithmetic
kevaundray Feb 3, 2023
adeca4d
maxbits -> "max bits"
kevaundray Feb 3, 2023
b48003e
typenames -> "type names"
kevaundray Feb 3, 2023
873df26
typecheck -> "type check"
kevaundray Feb 3, 2023
ff95eeb
preprocess -> "pre-process"
kevaundray Feb 3, 2023
8633133
comptime -> "comp time"
kevaundray Feb 3, 2023
069ecaa
subexpr -> subexpression
kevaundray Feb 3, 2023
cf32f97
virtualise -> virtualize
kevaundray Feb 3, 2023
40d1b8d
binded -> bound
kevaundray Feb 3, 2023
88d6c21
nodeobj -> "node object"
kevaundray Feb 3, 2023
02b3cd6
add note about foldl
kevaundray Feb 3, 2023
a4f6472
nodeobj -> node object
kevaundray Feb 3, 2023
dc833e3
comptime : use snake case and camel case
kevaundray Feb 3, 2023
17d4e83
ltype -> "lhs type"
kevaundray Feb 3, 2023
e257852
curr -> current
kevaundray Feb 3, 2023
1f2b9f7
failable -> fallible
kevaundray Feb 3, 2023
cd812ed
lowlevel -> "low-level"
kevaundray Feb 3, 2023
e4086e7
"forscope" -> "for-scope"
kevaundray Feb 3, 2023
e6e519b
nondeterministically -> non-deterministically
kevaundray Feb 3, 2023
1774597
subtyping -> "sub-typing"
kevaundray Feb 3, 2023
f64c579
pvalue -> "parent value"
kevaundray Feb 3, 2023
1ee7d1d
svec -> "slave vec"
kevaundray Feb 3, 2023
a96044c
binop -> "binary op"
kevaundray Feb 3, 2023
29eb200
bitcount -> "bit count"
kevaundray Feb 3, 2023
4a49b99
vmap -> "value map"
kevaundray Feb 3, 2023
39b7d30
tokenkind -> "token kind"
kevaundray Feb 3, 2023
0c30f6f
rtype -> (rhs_type/result_type)
kevaundray Feb 3, 2023
47abf0b
arraylen -> "array len"
kevaundray Feb 3, 2023
2c6c72e
ncrate -> crate
kevaundray Feb 3, 2023
6763278
cdir -> current_dir
kevaundray Feb 3, 2023
d073e6b
nvar -> "new var"
kevaundray Feb 3, 2023
244244c
igen -> ir_gen
kevaundray Feb 3, 2023
ca49b3d
cleanup dictionary
kevaundray Feb 3, 2023
d4c9e6b
Merge remote-tracking branch 'origin/master' into kw/add-cspell
kevaundray Feb 3, 2023
c815cb9
reformat dict list
kevaundray Feb 3, 2023
720ccf9
clarify comment on comptime
kevaundray Feb 3, 2023
87cc8ec
elems -> elements
kevaundray Feb 3, 2023
5dbda58
change authors
kevaundray Feb 3, 2023
b1ae6b6
Merge remote-tracking branch 'origin/master' into kw/add-cspell
kevaundray Feb 3, 2023
01735f4
change author in Cargo.toml
kevaundray Feb 3, 2023
b23794e
conditionalize -> "apply condition"
kevaundray Feb 3, 2023
e3f7857
optim -> optimizations
kevaundray Feb 3, 2023
c9b3af5
add "higher-kinded"
kevaundray Feb 3, 2023
c49bcec
separate words from dependencies and in code
kevaundray Feb 3, 2023
7f43202
re-order alphabetically
kevaundray Feb 3, 2023
9b9e897
remove comments in Cspell
kevaundray Feb 3, 2023
fc2b5e9
- Do not fail CI if spelling mistake is found
kevaundray Feb 3, 2023
57e77cc
fix typo: conf_data -> config_data
kevaundray Feb 3, 2023
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
11 changes: 11 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@ jobs:
with:
command: fmt
args: --all -- --check

spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: streetsidesoftware/cspell-action@v2
with:
files: |
**/*.{md,rs}
incremental_files_only : true # Run this action on files which have changed in PR
strict: false # Do not fail, if a spelling mistake is found (This can be annoying for contributors)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Before you create a pull request, create an issue that thoroughly describes the

Noir is still very new and there are many cryptographic primitives that we have yet to build that will be useful for the community. If you have other ideas, please reach out on the [Aztec Discord](https://discord.gg/aztec) to discuss. You can find the current list of requested primitives in the [issues section](https://github.com/noir-lang/noir/labels/noir-stdlib) marked with the label `noir-stdlib`.

## Funding Opportunties
## Funding Opportunities

Aztec is offering grants to people and teams that want to use, test or build Noir. You can find more information about the grants program [here](https://aztec.network/grants).

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ default-members = ["crates/nargo"]

[workspace.package]
version = "0.1.0"
authors = ["Kevaundray Wedderburn <[email protected]>"]
authors = ["The Noir Team <[email protected]>"]
edition = "2021"
rust-version = "1.64"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ The current focus is to gather as much feedback as possible while in the alpha p

Concretely the following items are on the road map:

- General code sanitisation and documentation (ongoing effort)
- Prover and Verifier Key logic. (Prover and Verifier preprocess per compile)
- General code sanitization and documentation (ongoing effort)
- Prover and Verifier Key logic. (Prover and Verifier pre-process per compile)
- Fallback mechanism for backend unsupported opcodes
- Visibility modifiers
- Signed integers
Expand Down
4 changes: 2 additions & 2 deletions crates/fm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl FileManager {
let source = file_reader::read_file_to_string(path_to_file).ok()?;

let file_id = self.file_map.add_file(path_to_file.to_path_buf().into(), source);
let path_to_file = virtualise_path(path_to_file, file_type);
let path_to_file = virtualize_path(path_to_file, file_type);
self.register_path(file_id, path_to_file);

Some(file_id)
Expand Down Expand Up @@ -99,7 +99,7 @@ impl Default for FileManager {
/// Returns
/// For Normal filetypes, given "src/mod.nr" this method returns "src/mod"
/// For Root filetypes, given "src/mod.nr" this method returns "src"
fn virtualise_path(path: &Path, file_type: FileType) -> VirtualPath {
fn virtualize_path(path: &Path, file_type: FileType) -> VirtualPath {
let mut path = path.to_path_buf();
let path = match file_type {
FileType::Root => {
Expand Down
4 changes: 2 additions & 2 deletions crates/nargo/src/cli/compile_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
let witness = args.is_present("witness");
let allow_warnings = args.is_present("allow-warnings");

let curr_dir = std::env::current_dir().unwrap();
let current_dir = std::env::current_dir().unwrap();
let mut circuit_path = PathBuf::new();
circuit_path.push(TARGET_DIR);

let result = generate_circuit_and_witness_to_disk(
circuit_name,
curr_dir,
current_dir,
circuit_path,
witness,
allow_warnings,
Expand Down
4 changes: 2 additions & 2 deletions crates/nargo/src/cli/gates_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
}

pub fn count_gates(show_ssa: bool, allow_warnings: bool) -> Result<(), CliError> {
let curr_dir = std::env::current_dir().unwrap();
count_gates_with_path(curr_dir, show_ssa, allow_warnings)
let current_dir = std::env::current_dir().unwrap();
count_gates_with_path(current_dir, show_ssa, allow_warnings)
}

pub fn count_gates_with_path<P: AsRef<Path>>(
Expand Down
6 changes: 3 additions & 3 deletions crates/nargo/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn start_cli() {
let matches = App::new("nargo")
.about("Noir's package manager")
.version(VERSION_STRING)
.author("Kevaundray Wedderburn <[email protected]>")
.author("The Noir Team <[email protected]>")
.subcommand(
App::new("check")
.about("Checks the constraint system for errors")
Expand Down Expand Up @@ -89,7 +89,7 @@ pub fn start_cli() {
)
.subcommand(
App::new("gates")
.about("Counts the occurences of different gates in circuit")
.about("Counts the occurrences of different gates in circuit")
.arg(show_ssa)
.arg(allow_warnings),
)
Expand Down Expand Up @@ -170,7 +170,7 @@ fn write_inputs_to_file<P: AsRef<Path>>(
dir_path
};

let serialized_output = format.serialise(w_map)?;
let serialized_output = format.serialize(w_map)?;
write_to_file(serialized_output.as_bytes(), &file_path);

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/nargo/src/cli/prove_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
const WITNESS_OFFSET: u32 = 1;

fn prove(proof_name: Option<&str>, show_ssa: bool, allow_warnings: bool) -> Result<(), CliError> {
let curr_dir = std::env::current_dir().unwrap();
let current_dir = std::env::current_dir().unwrap();

let mut proof_dir = PathBuf::new();
proof_dir.push(PROOFS_DIR);

prove_with_path(proof_name, curr_dir, proof_dir, show_ssa, allow_warnings)?;
prove_with_path(proof_name, current_dir, proof_dir, show_ssa, allow_warnings)?;

Ok(())
}
Expand Down
8 changes: 4 additions & 4 deletions crates/nargo/src/cli/verify_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
}

fn verify(proof_name: &str, allow_warnings: bool) -> Result<bool, CliError> {
let curr_dir = std::env::current_dir().unwrap();
let current_dir = std::env::current_dir().unwrap();
let mut proof_path = PathBuf::new(); //or cur_dir?
proof_path.push(PROOFS_DIR);
proof_path.push(Path::new(proof_name));
proof_path.set_extension(PROOF_EXT);
verify_with_path(&curr_dir, &proof_path, false, allow_warnings)
verify_with_path(&current_dir, &proof_path, false, allow_warnings)
}

pub fn verify_with_path<P: AsRef<Path>>(
Expand All @@ -50,9 +50,9 @@ pub fn verify_with_path<P: AsRef<Path>>(
let public_abi = compiled_program.abi.clone().unwrap().public_abi();
let num_pub_params = public_abi.num_parameters();
if num_pub_params != 0 {
let curr_dir = program_dir;
let current_dir = program_dir;
public_inputs =
read_inputs_from_file(curr_dir, VERIFIER_INPUT_FILE, Format::Toml, public_abi)?;
read_inputs_from_file(current_dir, VERIFIER_INPUT_FILE, Format::Toml, public_abi)?;
}

let valid_proof = verify_proof(compiled_program, public_inputs, load_proof(proof_path)?)?;
Expand Down
26 changes: 13 additions & 13 deletions crates/nargo/tests/prove_and_verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,34 @@ mod tests {

#[test]
fn noir_integration() {
let mut cdir = std::env::current_dir().unwrap();
cdir.push(TEST_DIR);
cdir.push(TEST_DATA_DIR);
let mut current_dir = std::env::current_dir().unwrap();
current_dir.push(TEST_DIR);
current_dir.push(TEST_DATA_DIR);

//load config.tml file from test_data directory
cdir.push(CONFIG_FILE);
let config_path = std::fs::read_to_string(cdir).unwrap();
let conf_data: BTreeMap<String, Vec<String>> = load_conf(&config_path);
let mut cdir = std::env::current_dir().unwrap();
cdir.push(TEST_DIR);
cdir.push(TEST_DATA_DIR);
current_dir.push(CONFIG_FILE);
let config_path = std::fs::read_to_string(current_dir).unwrap();
let config_data: BTreeMap<String, Vec<String>> = load_conf(&config_path);
let mut current_dir = std::env::current_dir().unwrap();
current_dir.push(TEST_DIR);
current_dir.push(TEST_DATA_DIR);

for c in fs::read_dir(cdir.as_path()).unwrap().flatten() {
for c in fs::read_dir(current_dir.as_path()).unwrap().flatten() {
if let Ok(test_name) = c.file_name().into_string() {
println!("Running test {test_name:?}");
if c.path().is_dir() && !conf_data["exclude"].contains(&test_name) {
if c.path().is_dir() && !config_data["exclude"].contains(&test_name) {
let verified = std::panic::catch_unwind(|| {
nargo::cli::prove_and_verify("pp", &c.path(), false)
});

let r = match verified {
Ok(result) => result,
Err(_) => {
panic!("\n\n\nPanic occured while running test {:?} (ignore the following panic)", c.file_name());
panic!("\n\n\nPanic occurred while running test {:?} (ignore the following panic)", c.file_name());
}
};

if conf_data["fail"].contains(&test_name) {
if config_data["fail"].contains(&test_name) {
assert!(!r, "{:?} should not succeed", c.file_name());
} else {
assert!(r, "verification fail for {:?}", c.file_name());
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/tests/test_data/range_fail/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Multiple integers constraints.
//
// There is currently no range optimiser currently in ACIR :(
// There is currently no range optimizer currently in ACIR :(
//
fn main(x: u8, y: Field) {
let _z = x + (y as u8);
Expand Down
4 changes: 2 additions & 2 deletions crates/noirc_abi/src/input_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ impl Format {
}
}

pub fn serialise(
pub fn serialize(
&self,
w_map: &BTreeMap<String, InputValue>,
) -> Result<String, InputParserError> {
match self {
Format::Toml => toml::serialise_to_toml(w_map),
Format::Toml => toml::serialize_to_toml(w_map),
}
}
}
2 changes: 1 addition & 1 deletion crates/noirc_abi/src/input_parser/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn parse_toml(
})
}

pub(crate) fn serialise_to_toml(
pub(crate) fn serialize_to_toml(
w_map: &BTreeMap<String, InputValue>,
) -> Result<String, InputParserError> {
// Toml requires that values be emitted before tables. Thus, we must reorder our map in case a TomlTypes::Table comes before any other values in the toml map
Expand Down
12 changes: 6 additions & 6 deletions crates/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use noirc_evaluator::create_circuit;
use noirc_frontend::graph::{CrateId, CrateName, CrateType, LOCAL_CRATE};
use noirc_frontend::hir::def_map::CrateDefMap;
use noirc_frontend::hir::Context;
use noirc_frontend::monomorphisation::monomorphise;
use noirc_frontend::monomorphization::monomorphize;
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};

Expand Down Expand Up @@ -127,12 +127,12 @@ impl Driver {
}

// NOTE: Maybe build could be skipped given that now it is a pass through method.
/// Statically analyses the local crate
/// Statically analyzes the local crate
pub fn check(&mut self, allow_warnings: bool) {
self.analyse_crate(allow_warnings)
self.analyze_crate(allow_warnings)
}

fn analyse_crate(&mut self, allow_warnings: bool) {
fn analyze_crate(&mut self, allow_warnings: bool) {
let mut errs = vec![];
CrateDefMap::collect_defs(LOCAL_CRATE, &mut self.context, &mut errs);
let mut error_count = 0;
Expand Down Expand Up @@ -187,7 +187,7 @@ impl Driver {
let func_meta = self.context.def_interner.function_meta(&main_function);
let abi = func_meta.into_abi(&self.context.def_interner);

let program = monomorphise(main_function, self.context.def_interner);
let program = monomorphize(main_function, self.context.def_interner);

// Compile Program
let circuit = match create_circuit(
Expand All @@ -199,7 +199,7 @@ impl Driver {
Ok(circuit) => circuit,
Err(err) => {
// The FileId here will be the file id of the file with the main file
// Errors will be shown at the callsite without a stacktrace
// Errors will be shown at the call site without a stacktrace
let file_id = err.location.map(|loc| loc.file);
let error_count = Reporter::with_diagnostics(
file_id,
Expand Down
8 changes: 4 additions & 4 deletions crates/noirc_driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ fn main() {
driver.create_local_crate(ROOT_DIR_MAIN, CrateType::Binary);

// Add libraries into Driver
let ncrate_id1 = driver.create_non_local_crate(EXTERNAL_DIR2, CrateType::Library);
let ncrate_id2 = driver.create_non_local_crate(EXTERNAL_DIR, CrateType::Library);
let crate_id1 = driver.create_non_local_crate(EXTERNAL_DIR2, CrateType::Library);
let crate_id2 = driver.create_non_local_crate(EXTERNAL_DIR, CrateType::Library);

// Add dependencies as package
driver.add_dep(LOCAL_CRATE, ncrate_id1, "coo4");
driver.add_dep(LOCAL_CRATE, ncrate_id2, "coo3");
driver.add_dep(LOCAL_CRATE, crate_id1, "coo4");
driver.add_dep(LOCAL_CRATE, crate_id2, "coo3");

driver.into_compiled_program(acvm::Language::R1CS, false, false);
}
Loading