diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06b44da..0309ae9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Test with pytest run: | uv run pytest - # Test that the compiled programs are compatible the Nillion backend. + # Test that the compiled programs are compatible with the Nillion backend. test: runs-on: ubuntu-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8977f4b..6121c40 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,6 @@ # Release workflow # - When there is a push to 'main', it detects if the local version has changed and is higher than the remote (PyPI) version. -# - Generates a new nada-dsl release, signes it and pushes it to PyPI when a PR is merged that updates the version number in pyproject.toml. +# - Generates a new nada-dsl release, signs it, and pushes it to PyPI when a PR is merged that updates the version number in pyproject.toml. # - Generates a new nada-dsl Github release name: Create a new release diff --git a/.pylintrc b/.pylintrc index 8f6ec9e..9b86b67 100644 --- a/.pylintrc +++ b/.pylintrc @@ -34,7 +34,7 @@ extension-pkg-allow-list= extension-pkg-whitelist= # Return non-zero exit code if any of these messages/categories are detected, -# even if score is above --fail-under value. Syntax same as enable. Messages +# even if the score is above --fail-under value. Syntax same as enable. Messages # specified are enabled, while categories only check already-enabled messages. fail-on= @@ -48,7 +48,7 @@ fail-under=10 # Files or directories to be skipped. They should be base names, not paths. ignore=CVS -# Add files or directories matching the regular expressions patterns to the +# Add files or directories matching the regular expression patterns to the # ignore-list. The regex matches against paths and can be in Posix or Windows # format. Because '\\' represents the directory delimiter on Windows systems, # it can't be used as an escape character. @@ -293,7 +293,7 @@ max-attributes=7 # Maximum number of boolean expressions in an if statement (see R0916). max-bool-expr=5 -# Maximum number of branch for function / method body. +# Maximum number of branches for function / method body. max-branches=12 # Maximum number of locals for function / method body. @@ -417,8 +417,8 @@ confidence=HIGH, # option multiple times (only on the command line, not in the configuration # file where it should appear only once). You can also use "--disable=all" to # disable everything first and then re-enable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have +# If you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". disable=raw-checker-failed, @@ -435,8 +435,8 @@ disable=raw-checker-failed, W0223,W0718,R0903,R0913,R0801,R0401,W0231,W0603 # Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where +# either give multiple identifiers separated by comma (,) or put this option +# multiple times (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. enable= @@ -464,7 +464,7 @@ notes-rgx= # Maximum number of nested blocks for function / method body max-nested-blocks=5 -# Complete name of functions that never returns. When checking for +# Complete name of functions that never return. When checking for # inconsistent-return-statements if a never returning function is called then # it will be considered as an explicit return statement and no message will be # printed. @@ -616,7 +616,7 @@ allow-global-unused-variables=yes # List of names allowed to shadow builtins allowed-redefined-builtins= -# List of strings which can identify a callback function by name. A callback +# List of strings that can identify a callback function by name. A callback # name must start or end with one of those strings. callbacks=cb_, _cb diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3ee498..bbf9669 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ We recommend continuously running your code through `pylint` and `mypy` during t ### Installation -1. Install [black](https://pypi.org/project/black/) and [isort](https://pycqa.github.io/isort/) for code formating +1. Install [black](https://pypi.org/project/black/) and [isort](https://pycqa.github.io/isort/) for code formatting ```bash pip3 install black && isort ``` @@ -56,4 +56,4 @@ poetry run mypy We use [GitHub issues](https://github.com/NillionNetwork/nada-dsl/issues/new/choose) to report bugs and typos, or to suggest new ideas. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue. ## License -By contributing to `nada-dsl`, you agree that your contributions will be licensed under the [LICENSE](./LICENSE) file in the root directory of this source tree. \ No newline at end of file +By contributing to `nada-dsl`, you agree that your contributions will be licensed under the [LICENSE](./LICENSE) file in the root directory of this source tree. diff --git a/nada_dsl/nada_types/__init__.py b/nada_dsl/nada_types/__init__.py index f65a47f..6dd715c 100644 --- a/nada_dsl/nada_types/__init__.py +++ b/nada_dsl/nada_types/__init__.py @@ -121,7 +121,7 @@ class NadaType: In Nada, all the types wrap Operations. For instance, an addition between two integers is represented like this SecretInteger(child=Addition(...)). - In MIR, the representation is based around operations. A MIR operation points to other + In MIR, the representation is based on operations. A MIR operation points to other operations and has a return type. To aid MIR conversion, we store in memory (`AST_OPERATIONS`) all the operations in a @@ -154,7 +154,7 @@ def to_mir(self): def class_to_mir(cls) -> str: """Converts a class into a MIR Nada type.""" name = cls.__name__ - # Rename public variables so they are considered as the same as literals. + # Rename public variables so they are considered the same as literals. if name.startswith("Public"): name = name[len("Public") :].lstrip() return name diff --git a/nada_dsl/nada_types/scalar_types.py b/nada_dsl/nada_types/scalar_types.py index 3d40991..252a6c3 100644 --- a/nada_dsl/nada_types/scalar_types.py +++ b/nada_dsl/nada_types/scalar_types.py @@ -9,7 +9,7 @@ from nada_dsl import SourceRef from . import NadaType, Mode, BaseType, OperationType -# Constant dictionary that stores all the Nada types and is use to +# Constant dictionary that stores all the Nada types and is used to # convert from the (mode, base_type) representation to the concrete Nada type # (Integer, SecretBoolean,...) diff --git a/tests/scalar_type_test.py b/tests/scalar_type_test.py index 94b9aa3..4b2eb15 100644 --- a/tests/scalar_type_test.py +++ b/tests/scalar_type_test.py @@ -168,7 +168,7 @@ def test_shift(left: ScalarType, right: ScalarType, operation): # Binary relational operations. -# Equals and NotEquals are not included, because they accept by the Boolean types as well +# Equals and NotEquals are not included, because they are accepted by the Boolean types as well binary_relational_functions = [ lambda lhs, rhs: lhs < rhs, lambda lhs, rhs: lhs > rhs, @@ -409,7 +409,7 @@ def test_not_allowed_pow(left, right): assert invalid_operation.type == TypeError -# List of operands that the shift operation do not accept. +# List of operands that the shift operation does not accept. not_allowed_shift = ( combine_lists(combine_lists(booleans, booleans), shift_functions) + combine_lists(combine_lists(integers, booleans), shift_functions)