diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 2db6d522..00000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Lint - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - - lint: - runs-on: windows-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - path: code - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - name: debugging - run: dir -l code - - name: Install dependencies (flake8) - run: pip install -r code/.github/workflows/requirements.txt - - name: Lint - run: flake8 code/addon --max-line-length=130 --extend-exclude=code/addon/globalPlugins/MathCAT/yaml/* - - name: type check - uses: jakebailey/pyright-action@v1 - with: - working-directory: code/addon/globalPlugins/MathCAT - python-version: 3.11 - pylance-version: latest-release diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt deleted file mode 100644 index 79ef110f..00000000 --- a/.github/workflows/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -####### requirements.txt ####### -# -###### Requirements for automated lint ###### -flake8 >= 3.8 -flake8-tabs >= 2.3 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20f42cca..d5c872f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,14 +42,14 @@ repos: - id: debug-statements # Removes trailing whitespace. - id: trailing-whitespace - types_or: [python, c, c++, batch, markdown, toml, yaml] + types_or: [python, batch, markdown, toml, yaml, rust] # Ensures all files end in 1 (and only 1) newline. - id: end-of-file-fixer - types_or: [python, c, c++, batch, markdown, toml, yaml] + types_or: [python, batch, markdown, toml, yaml, rust] # Removes the UTF-8 BOM from files that have it. # See https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/codingStandards.md#encoding - id: fix-byte-order-marker - types_or: [python, c, c++, batch, markdown, toml, yaml] + types_or: [python, batch, markdown, toml, yaml, rust] # Validates TOML files. - id: check-toml # Validates YAML files. diff --git a/Cargo.toml b/Cargo.toml index 2549373d..7b4eeed5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ version = "0.22" features = ["extension-module", "abi3"] [build-dependencies] -zip = { version = "2.6", default-features = false, features = ["bzip2"] } +zip = { version = "3.0", default-features = false, features = ["bzip2"] } mathcat = {version = "=0.6.9", features = ["include-zip"]} # for building, we want the zip files so we can include them separately # mathcat = { path = "../MathCAT/", features = ["include-zip"]} # for building, we want the zip files so we can include them separately # for testing MathCAT without having to publish a new version (change two occurrences) diff --git a/build.rs b/build.rs index 6e40b59f..ac4f5757 100644 --- a/build.rs +++ b/build.rs @@ -13,4 +13,4 @@ fn main() { let mut zip_archive = ZipArchive::new(archive).unwrap(); zip_archive.extract(&location).expect("Zip extraction failed"); -} \ No newline at end of file +} diff --git a/src/lib.rs b/src/lib.rs index d02b74ad..e53a7fa3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ //! 1. whatever preferences the AT needs to set, it is done with calls to [`SetPreference`]. //! 2. the MathML is sent over via [`SetMathML`]. //! 3. AT calls to get the speech [`GetSpokenText`] and calls [`GetBraille`] to get the (Unicode) braille. -//! +//! //! Navigation can be done via calls to either: //! * [`DoNavigateKeyPress`] (takes key events as input) //! * [`DoNavigateCommand`] (takes the commands the key events internally map to) @@ -14,7 +14,7 @@ //! * [`GetNavigationMathML`] -- returns a string representing the MathML for the selected node //! Note: a second integer is returned. This is the offset in characters for a leaf node. //! This is needed when navigating by character for multi-symbol leaf nodes such as "sin" and "1234" -//! +//! //! It is also possible to find out what preferences are currently set by calling [`GetPreference`] //! //! AT can pass key strokes to allow a user to navigate the MathML by calling [`DoNavigateKeyPress`]; the speech is returned. @@ -97,7 +97,7 @@ pub fn GetPreference(_py: Python, name: String) -> PyResult { #[pyfunction] /// Get the braille associated with the MathML node with a given id (MathML set by `SetMathML`]). /// An empty string can be used to return the braille associated with the entire expression. -/// +/// /// The braille returned depends upon the preference for braille output. pub fn GetBraille(_py: Python, nav_node_id: String) -> PyResult { return convert_error( get_braille(nav_node_id) ); @@ -106,7 +106,7 @@ pub fn GetBraille(_py: Python, nav_node_id: String) -> PyResult { #[pyfunction] /// Get the braille associated with the MathML node with a given id (MathML set by `SetMathML`]). /// An empty string can be used to return the braille associated with the entire expression. -/// +/// /// The braille returned depends upon the preference for braille output. pub fn GetNavigationBraille(_py: Python) -> PyResult { return convert_error( get_navigation_braille() ); @@ -124,17 +124,17 @@ pub fn DoNavigateKeyPress(_py: Python, key: usize, shift_key: bool, control_key: /// Given a command, the current node is moved accordingly (or value reported in some cases). /// /// The spoken text for the new current node is returned. -/// +/// /// The list of legal commands are: -/// "MovePrevious", "MoveNext", "MoveStart", "MoveEnd", "MoveLineStart", "MoveLineEnd", -/// "MoveCellPrevious", "MoveCellNext", "MoveCellUp", "MoveCellDown", "MoveColumnStart", "MoveColumnEnd", -/// "ZoomIn", "ZoomOut", "ZoomOutAll", "ZoomInAll", -/// "MoveLastLocation", -/// "ReadPrevious", "ReadNext", "ReadCurrent", "ReadCellCurrent", "ReadStart", "ReadEnd", "ReadLineStart", "ReadLineEnd", -/// "DescribePrevious", "DescribeNext", "DescribeCurrent", -/// "WhereAmI", "WhereAmIAll", -/// "ToggleZoomLockUp", "ToggleZoomLockDown", "ToggleSpeakMode", -/// "Exit", +/// "MovePrevious", "MoveNext", "MoveStart", "MoveEnd", "MoveLineStart", "MoveLineEnd", +/// "MoveCellPrevious", "MoveCellNext", "MoveCellUp", "MoveCellDown", "MoveColumnStart", "MoveColumnEnd", +/// "ZoomIn", "ZoomOut", "ZoomOutAll", "ZoomInAll", +/// "MoveLastLocation", +/// "ReadPrevious", "ReadNext", "ReadCurrent", "ReadCellCurrent", "ReadStart", "ReadEnd", "ReadLineStart", "ReadLineEnd", +/// "DescribePrevious", "DescribeNext", "DescribeCurrent", +/// "WhereAmI", "WhereAmIAll", +/// "ToggleZoomLockUp", "ToggleZoomLockDown", "ToggleSpeakMode", +/// "Exit", /// "MoveTo0","MoveTo1","MoveTo2","MoveTo3","MoveTo4","MoveTo5","MoveTo6","MoveTo7","MoveTo8","MoveTo9", /// "Read0","Read1","Read2","Read3","Read4","Read5","Read6","Read7","Read8","Read9", /// "Describe0","Describe1","Describe2","Describe3","Describe4","Describe5","Describe6","Describe7","Describe8","Describe9", @@ -192,4 +192,4 @@ mod py_tests { Err(e) => panic!("Error remains {}", e.to_string()), } } -} \ No newline at end of file +}