Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/tools/lint/test/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  test_ruff_format.py

  Sprache: Python
 

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import mozunit

LINTER = "ruff-format"
fixed = 0


def test_lint_fix(lint, create_temp_file):
    contents = """def is_unique(
               s
               ):
    s = list(s
                )
    s.sort()


    for i in range(len(s) - 1):
        if s[i] == s[i + 1]:
            return 0
    else:
        return 1


if __name__ == "__main__":
    print(
          is_unique(input())
         ) """

    path = create_temp_file(contents, "bad.py")
    lint([path], fix=True)
    assert fixed == 1


def test_lint_ruff_format(lint, paths):
    results = lint(paths())
    assert len(results) == 2

    assert results[0].level == "error"
    assert results[0].relpath.endswith("bad.py")
    assert results[0].lineno == 4
    assert results[0].column == 6

    assert "EOF" in results[1].message
    assert results[1].level == "error"
    assert results[1].relpath.endswith("invalid.py")


if __name__ == "__main__":
    mozunit.main()

Messung V0.5 in Prozent
C=95 H=98 G=96

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.