# cwltool.validate_js

## Classes

`SuppressLog` | Filter instances are used to perform arbitrary filtering of LogRecords.
`JSHintJSReturn` | List of errors and the final values of the globals from running javascript.

## Functions

`is_expression`(tool, schema) | Test a field/schema combo to see if it is a CWL Expression.
`get_expressions`(tool, schema[, source_line]) |
`jshint_js`(js_text[, globals, options, ...]) |
`print_js_hint_messages`(js_hint_messages, source_line) | Log the message from JSHint, using the line number.
`validate_js_expressions`(tool, schema[, ...]) |

## Module Contents

cwltool.validate_js.is_expression(tool, schema)

  Test a field/schema combo to see if it is a CWL Expression.

  Parameters:

    - tool (Any)

    - schema (schema_salad.avro.schema.Schema | None)

  Return type:

    bool

class cwltool.validate_js.SuppressLog(name)

  Bases: `logging.Filter`

  Filter instances are used to perform arbitrary filtering of LogRecords.

  Loggers and Handlers can optionally use Filter instances to filter records as desired. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with “A.B” will allow events logged by loggers “A.B”, “A.B.C”, “A.B.C.D”, “A.B.D” etc. but not “A.BB”, “B.A.B” etc. If initialized with the empty string, all events are passed.

  Parameters:

    name (str)

  filter(record)

    Never accept a record.

    Parameters:

      record (logging.LogRecord)

    Return type:

      bool

cwltool.validate_js.get_expressions(tool, schema, source_line=None)
  Parameters:

    - tool (ruamel.yaml.comments.CommentedMap | str | ruamel.yaml.comments.CommentedSeq)

    - schema (schema_salad.avro.schema.Schema | schema_salad.avro.schema.ArraySchema | None)

    - source_line (schema_salad.sourceline.SourceLine | None)

  Return type:

    list[tuple[str, schema_salad.sourceline.SourceLine | None]]

class cwltool.validate_js.JSHintJSReturn

  Bases: `NamedTuple`

  List of errors and the final values of the globals from running javascript.

  errors: list[str]
  globals: list[str]

cwltool.validate_js.jshint_js(js_text, globals=None, options=None, container_engine='docker', eval_timeout=60)
  Parameters:

    - js_text (str)

    - globals (list[str] | None)

    - options (dict[str, list[str] | str | int] | None)

    - container_engine (str)

    - eval_timeout (float)

  Return type:

    JSHintJSReturn

cwltool.validate_js.print_js_hint_messages(js_hint_messages, source_line)

  Log the message from JSHint, using the line number.

  Parameters:

    - js_hint_messages (list[str])

    - source_line (schema_salad.sourceline.SourceLine | None)

  Return type:

    None

cwltool.validate_js.validate_js_expressions(tool, schema, jshint_options=None, container_engine='docker', eval_timeout=60)
  Parameters:

    - tool (ruamel.yaml.comments.CommentedMap)

    - schema (schema_salad.avro.schema.Schema)

    - jshint_options (dict[str, list[str] | str | int] | None)

    - container_engine (str)

    - eval_timeout (float)

  Return type:

    None