ocaml.lang.portability.slash_tmp.not-portable-tmp-string

profile photo of returntocorpreturntocorp
Author
5,486
Download Count*

You should probably use Filename.get_temp_dirname().

Run Locally

Run in CI

Defintion

rules:
  - id: not-portable-tmp-string
    pattern: |
      "=~/\/tmp/"
    message: You should probably use Filename.get_temp_dirname().
    languages:
      - ocaml
    severity: WARNING
    metadata:
      category: portability
      license: Commons Clause License Condition v1.0[LGPL-2.1-only]

Examples

slash_tmp.ml

let test a =
  (* ruleid:not-portable-tmp-string *)
  let path = Filename.concat "/tmp" a in
  print_string path