megalinter icon indicating copy to clipboard operation
megalinter copied to clipboard

New feature : PHP linters with support of SARIF output format

Open llaville opened this issue 1 year ago • 2 comments

Fixes #3515

Readiness Checklist

Author/Contributor

  • [x] Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • [ ] If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • [ ] Label as breaking if this is a large fundamental change
  • [ ] Label as either automation, bug, documentation, enhancement, infrastructure, or performance

llaville avatar May 10 '24 03:05 llaville

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ API spectral 2 0 3.3s
✅ BASH bash-exec 5 0 0.05s
✅ BASH shellcheck 5 0 0.15s
✅ BASH shfmt 5 0 0 0.58s
✅ COPYPASTE jscpd yes no 3.87s
✅ DOCKERFILE hadolint 129 0 17.9s
✅ JSON jsonlint 18 0 0.26s
✅ JSON v8r 20 0 27.86s
⚠️ MARKDOWN markdownlint 264 0 268 33.88s
✅ MARKDOWN markdown-table-formatter 264 0 0 143.5s
✅ OPENAPI spectral 2 0 3.29s
⚠️ PYTHON bandit 210 64 3.39s
✅ PYTHON black 210 0 0 6.4s
✅ PYTHON flake8 210 0 2.37s
✅ PYTHON isort 210 0 0 1.31s
✅ PYTHON mypy 210 0 20.06s
✅ PYTHON pylint 210 0 18.23s
✅ PYTHON ruff 210 0 0 0.62s
✅ REPOSITORY checkov yes no 42.29s
✅ REPOSITORY git_diff yes no 0.56s
⚠️ REPOSITORY grype yes 1 27.76s
✅ REPOSITORY secretlint yes no 19.01s
✅ REPOSITORY trivy yes no 27.63s
✅ REPOSITORY trivy-sbom yes no 12.9s
⚠️ REPOSITORY trufflehog yes 1 12.82s
✅ SPELL cspell 689 0 30.31s
⚠️ SPELL lychee 344 1 10.21s
✅ XML xmllint 3 0 0 0.58s
✅ YAML prettier 161 0 0 6.81s
✅ YAML v8r 102 0 196.92s
✅ YAML yamllint 162 0 2.33s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

github-actions[bot] avatar May 10 '24 03:05 github-actions[bot]

I should have forget something ! Help is welcome

llaville avatar May 10 '24 03:05 llaville

@llaville of beta version was broken, i just fixed it :)

Did you run bash build.sh to generate the Dockerfiles from the descriptors ?

nvuillam avatar May 12 '24 23:05 nvuillam

Did you run bash build.sh to generate the Dockerfiles from the descriptors ?

@nvuillam I've got following error

Traceback (most recent call last):
  File "/home/llaville/devilbox_data/github/megalinter/./.automation/build.py", line 18, in <module>
    import git
ModuleNotFoundError: No module named 'git'

on WSL-2 / Ubuntu 22.04 LTS platform

OK: I know now why, but the Contributing Guide need to be upgrade ...

llaville avatar May 13 '24 02:05 llaville

On Contributing Guide, we can read

With write access

    Clone the repository (only if you have write access)
    Create a new branch: git checkout -b my-branch-name
    Make your change
    Update CHANGELOG.md (the root one, not the one in /docs)
    Run bash build.sh to regenerate dockerfile from updated sources (run bash build.sh --doc if you want to also regenerate documentation)
    Push and [submit a pull request](https://github.com/oxsecurity/megalinter/compare)
    Pat yourself on the back and wait for your pull request to be reviewed and merged.

Or

Without write access

    [Fork](https://github.com/oxsecurity/megalinter/fork) and clone the repository
    Create a new branch: git checkout -b my-branch-name
    Make your change
    Update CHANGELOG.md (the root one, not the one in /docs)
    Run bash build.sh to regenerate dockerfile from updated sources (run bash build.sh --doc if you want to also regenerate documentation)
    Push to your fork and [submit a pull request](https://github.com/oxsecurity/megalinter/compare)
    Pat your self on the back and wait for your pull request to be reviewed and merged.

But we don't see that the venv is mandatory

mkdir venv
python -m venv venv/
source venv/bin/activate
pip install --upgrade -r .config/python/dev/requirements.txt

As I do not contribute all days, I forgot it (and I prefer to see it in guide rather than remember it)

llaville avatar May 13 '24 03:05 llaville

Ok now for PHP linters but there are still issues with at least

github com_oxsecurity_megalinter_actions_runs_9056743612

llaville avatar May 13 '24 04:05 llaville

Ok now for PHP linters but there are still issues with at least

github com_oxsecurity_megalinter_actions_runs_9056743612

Re-running, sometimes randomly fails...

bdovaz avatar May 13 '24 05:05 bdovaz

Not so randomly.... when it fails it's often because some remote server decides to not respond to our calls :p

nvuillam avatar May 13 '24 07:05 nvuillam