Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature : PHP linters with support of SARIF output format #3551

Merged
merged 8 commits into from
May 13, 2024

Conversation

llaville
Copy link
Collaborator

Fixes #3515

Readiness Checklist

Author/Contributor

  • 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

Copy link
Contributor

github-actions bot commented May 10, 2024

🦙 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

@llaville
Copy link
Collaborator Author

I should have forget something ! Help is welcome

@nvuillam
Copy link
Member

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

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

@llaville
Copy link
Collaborator Author

llaville commented May 13, 2024

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

github com_oxsecurity_megalinter_actions_runs_9056743612

@bdovaz
Copy link
Collaborator

bdovaz commented May 13, 2024

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...

@nvuillam
Copy link
Member

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

Copy link
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are all green :)

Thanks for this stunning contribution @llaville , MegaLinter PHP coverage wouldn't be the same without you :)

@nvuillam nvuillam merged commit 086f6f6 into main May 13, 2024
126 checks passed
@nvuillam nvuillam deleted the features/php-linters-with-sarif branch May 13, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SARIF support to all PHP linters
3 participants