Crest Infosolutions Git Repository

  1. 04 Nov, 2020 2 commits
  2. 03 Nov, 2020 1 commit
  3. 02 Nov, 2020 3 commits
  4. 31 Oct, 2020 1 commit
  5. 30 Oct, 2020 2 commits
    • Martin Jambon's avatar
      Fix impossible matching on files not containing a newline (#1929) · 7b71aa3a
      Martin Jambon authored
      * Allow spacecat to read from files or directories instead of stding.
      
      * Fix off-by-one error in line count, leading to one-line files being
      treated as gibberish (non-text) and ignored. A warning is now printed on
      stderr if a file is ignored.
      
      * Print one blank line between matches, not systematically after a match.
      
      Co-authored-by: Martin Jambon <Martin Jambon>
      7b71aa3a
    • Yoann Padioleau's avatar
      Remove semgrep-core/finding/, and enable back LSP (#1921) · 3ea9d866
      Yoann Padioleau authored
      * Remove semgrep-core/finding/
      
      The file filtering is now handled in the Python wrapper so
      we don't need this code anymore. Morever the code uses
      the Dune.glob library which conflicts with the LSP library, so
      time to remove it anyway.
      
      test plan:
      make
      
      * Uncomment the commented LSP code now that LSP is in OPAM
      
      test plan:
      make
      make test
      
      * Use latest pfff fixing OCaml parse error regarding GADTs
      
      Test plan:
      make check now works
      
      * Upgrade to a more recent base image in Dockerfile.
      
      Co-authored-by: Martin Jambon <Martin Jambon>
      3ea9d866
  6. 29 Oct, 2020 5 commits
  7. 28 Oct, 2020 5 commits
  8. 27 Oct, 2020 12 commits
  9. 26 Oct, 2020 2 commits
  10. 23 Oct, 2020 7 commits
    • mschwager's avatar
      Error out in --test if ruleid or ok not in reported IDs (#1875) · a2c82a6a
      mschwager authored
      * Error out in --test if ruleid or ok not in reported IDs
      
      * Check for results without accompanying tests too
      a2c82a6a
    • Sabrina Brogren's avatar
      991942e8
    • Brendon Go's avatar
      Fix off by one in autofix (#1887) · 0b11ac45
      Brendon Go authored
      Also modified autofix tests to actually verify inline autofix
      0b11ac45
    • Yoann Padioleau's avatar
      Test files showing we now visit nested JSX elements (#1884) · 0b835802
      Yoann Padioleau authored
      Fixes https://github.com/returntocorp/semgrep/issues/1841
      
      test plan:
      test file included
      make
      make test
      also tried in semgrep and against semgrep-rules and no regressions
      0b835802
    • Yoann Padioleau's avatar
    • Yoann Padioleau's avatar
      Remove many of the .opam in semgrep-core (#1881) · b500bafb
      Yoann Padioleau authored
      Nobody needs the internal semgrep libraries, so switch
      from public_name to name in the dune files, which reduce the
      size of make install
      
      test plan:
      make
      make test
      b500bafb
    • Yoann Padioleau's avatar
      Leveraging tree-sitter error recovery in semgrep-core (#1880) · 8d158788
      Yoann Padioleau authored
      * First step in leveraging tree-sitter error recovery
      
      This is just the first step to help
      https://github.com/returntocorp/semgrep/issues/1879
      
      test plan:
      make
      make test
      
      * Step 2: Move code out of Parse_tree_sitters_helpers in Parse_code
      
      This move the code to the right place where we can leverage the
      returned list of errors.
      This also helps https://github.com/returntocorp/semgrep/issues/1879
      
      test plan:
      make
      make test
      
      * Step 3: handle Partial result in Parse_code.ml
      
      test plan:
      $ /home/pad/semgrep/_build/default/cli/Main.exe -lang js -e foo tests/OTHER/skipping_errors/test.js
      [0.086  Info       Main.Parse_code      ] trying to parse with TreeSitter parser tests/OTHER/skipping_errors/test.js
      [0.086  Info       Main.Parse_code      ] partial error (Parse_info.Parsing_error(_)) with TreeSitter parser
      [0.087  Info       Main.Parse_code      ] trying to parse with Pfff parser tests/OTHER/skipping_errors/test.js
      [0.087  Info       Main.Parse_code      ] running the pfff JS parser with 5s timeout
      [0.087  Debug      Main.Parse_code      ] exn (Parse_info.Parsing_error(_)) with Pfff parser
      [0.087  Debug      Main.Parse_code      ] exn again ((Failure "no parser found for tests/OTHER/skipping_errors/test.js")) but return original exn (Parse_info.Parsing_error(_))
      [0.087  Debug      Main.Parse_code      ] exn again (Parse_info.Parsing_error(_)) but return Partial
      tests/OTHER/skipping_errors/test.js:2
           foo();
      
      but we should also return errors (final step in next PR)
      
      * Final step: propagate recoved parsing errors to the top
      
      Test plan:
      See how below we now both print matched code and warn about parsing errors
      
      $ /home/pad/semgrep/_build/default/cli/Main.exe -lang js -e foo tests/OTHER/skipping_errors/test.js
      [0.109  Info       Main.Parse_code      ] trying to parse with TreeSitter parser tests/OTHER/skipping_errors/test.js
      [0.110  Info       Main.Parse_code      ] partial error (Parse_info.Parsing_error(_)) with TreeSitter parser
      [0.110  Info       Main.Parse_code      ] trying to parse with Pfff parser tests/OTHER/skipping_errors/test.js
      [0.110  Info       Main.Parse_code      ] running the pfff JS parser with 5s timeout
      [0.110  Debug      Main.Parse_code      ] exn (Parse_info.Parsing_error(_)) with Pfff parser
      [0.110  Debug      Main.Parse_code      ] exn again ((Failure "no parser found for tests/OTHER/skipping_errors/test.js")) but return original exn (Parse_info.Parsing_error(_))
      [0.110  Debug      Main.Parse_code      ] exn again (Parse_info.Parsing_error(_)) but return Partial
      WARNING: fail to fully parse tests/OTHER/skipping_errors/test.js
      tests/OTHER/skipping_errors/test.js:2
           foo();
      
      $  semgrep -l js -e foo test.js --verbose
      semgrep warn: parse error
        --> test.js:6
      6 |     return 1 %%% 2;
        |               ^^
      = help: If the code appears to be valid, this may be a semgrep bug.
      Could not parse test.js as js
      
      test.js
      2:    foo();
      ran 1 rules on 1 files: 1 findings
      1 files could not be analyzed; run with --verbose for details or run with --strict to exit non-zero if any file cannot be analyzed
      8d158788