{"id":13602854,"url":"https://github.com/neikei/syntaxchecks","last_synced_at":"2025-04-10T02:31:13.182Z","repository":{"id":166338577,"uuid":"102881303","full_name":"neikei/syntaxchecks","owner":"neikei","description":"Syntaxchecks for Bash, PHP, Python, Ruby, Yaml and Crontab files. Ready to use with Jenkins, Bamboo, Bitbucket Pipelines and Travis CI.","archived":false,"fork":false,"pushed_at":"2018-07-23T16:48:01.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T15:41:55.592Z","etag":null,"topics":["bamboo","bash","bitbucket-pipelines","continuous-testing","crontab","jenkins","php","python","ruby","syntaxcheck","travis-ci","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neikei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-09-08T16:20:55.000Z","updated_at":"2024-03-28T21:38:08.000Z","dependencies_parsed_at":"2023-06-09T05:00:48.764Z","dependency_job_id":null,"html_url":"https://github.com/neikei/syntaxchecks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neikei%2Fsyntaxchecks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neikei%2Fsyntaxchecks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neikei%2Fsyntaxchecks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neikei%2Fsyntaxchecks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neikei","download_url":"https://codeload.github.com/neikei/syntaxchecks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144193,"owners_count":21054881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bamboo","bash","bitbucket-pipelines","continuous-testing","crontab","jenkins","php","python","ruby","syntaxcheck","travis-ci","yaml"],"created_at":"2024-08-01T18:01:40.681Z","updated_at":"2025-04-10T02:31:12.873Z","avatar_url":"https://github.com/neikei.png","language":"Python","funding_links":[],"categories":["bash"],"sub_categories":[],"readme":"# Syntaxchecks\n\n[![Build Status](https://travis-ci.org/neikei/syntaxchecks.svg?branch=master)](https://travis-ci.org/neikei/syntaxchecks)\n\n\u003c!-- TOC --\u003e\n\n- [Syntaxchecks](#syntaxchecks)\n    - [Introduction](#introduction)\n    - [Requirements](#requirements)\n    - [Implemented checks](#implemented-checks)\n    - [Parameter](#parameter)\n    - [Usage](#usage)\n        - [Manual execution](#manual-execution)\n        - [Makefile](#makefile)\n        - [Jenkins](#jenkins)\n        - [Bamboo](#bamboo)\n        - [Bitbucket Pipelines](#bitbucket-pipelines)\n        - [Travis CI](#travis-ci)\n    - [Regular expressions](#regular-expressions)\n    - [Third party software](#third-party-software)\n\n\u003c!-- /TOC --\u003e\n\n## Introduction\n\nThe syntaxchecks are for PHP, Python, Ruby, Yaml and Crontab files. It is easy to use and implement into continuous integration tools like Jenkins, Bamboo and Bitbucket Pipeline.\n\n## Requirements\n\n- Git \u003e= 1.7\n- PHP \u003e= 5.6\n- Python \u003e= 2.7.12\n- Ruby \u003e= 2.3.1\n\n```bash\n# Installation on Debian/Ubuntu\nsudo apt install git php-cli python ruby\n```\n\n## Implemented checks\n\n- Bash\n- PHP\n- Python\n- Ruby\n- YAML\n- Crontabs\n\n## Parameter\n\n| Parameter | Description                       | Example             |\n|-----------|-----------------------------------|---------------------|\n| -p        | Path to the project               | -p \"/tmp/project\"   |\n| -s        | Enable strict mode (Default: off) | -s                  |\n| -a        | Check all files in path           | -a                  |\n| -c        | Check files in last commits       | -c 1                |\n| -r        | Overwrite exclude regex           | -r \"^.*/vendor/.*$\" |              |\n\n## Usage\n\n### Manual execution\n\n```bash\n# Check all files in project\n./syntaxchecks.sh -p \"/tmp/project\" -a\n\n# Check all files in project and stop at the first error\n./syntaxchecks.sh -p \"/tmp/project\" -a -s\n\n# Check all files in the last 5 commits of the project and stop at the first error\n./syntaxchecks.sh -p \"/tmp/project\" -c 5 -s\n```\n\n### Makefile\n\n```bash\n.PHONY: syntaxcheck\nsyntaxcheck:\n        @echo \"==\u003e Syntaxcheck started\"\n        wget https://github.com/neikei/syntaxchecks/archive/master.zip\n        unzip master.zip \u0026\u0026 rm master.zip\n        syntaxchecks-master/syntaxchecks.sh -p \"`pwd`\" -a -s\n        rm -rf syntaxchecks-master\n        @echo -e \"==\u003e Syntaxcheck finished\\n\"\n```\n\n### Jenkins\n\n```bash\n# Install syntaxchecks in the home path of the jenkins application user\nsu - jenkins\ncd ~\ngit clone https://github.com/neikei/syntaxchecks.git\n\n# Build step to execute the syntaxchecks with Jenkins\n~/syntaxchecks/syntaxchecks.sh -p \"`pwd`\" -c 1 -s\n```\n\n### Bamboo\n\n```bash\n# Install syntaxchecks in the home path of the bamboo application user\nsu - bamboo\ncd ~\ngit clone https://github.com/neikei/syntaxchecks.git\n\n# Build step to execute the syntaxchecks with Bamboo\n~/syntaxchecks/syntaxchecks.sh -p \"${bamboo.build.working.directory}\" -c 1 -s\n```\n\n### Bitbucket Pipelines\n\n```bash\nimage: php:7.1.1\n\npipelines:\n  default:\n    - step:\n        script:\n          - apt-get update \u0026\u0026 apt-get install -y unzip wget git php-cli python ruby\n          - wget https://github.com/neikei/syntaxchecks/archive/master.zip\n          - unzip master.zip \u0026\u0026 rm master.zip\n          - syntaxchecks-master/syntaxchecks.sh -p \"`pwd`\" -c 1 -s\n          - rm -rf syntaxchecks-master\n```\n\n### Travis CI\n\n```bash\nscript:\n  - wget https://github.com/neikei/syntaxchecks/archive/master.zip\n  - unzip master.zip \u0026\u0026 rm master.zip\n  - syntaxchecks-master/syntaxchecks.sh -p \"`pwd`\" -a -s\n```\n\n## Regular expressions\n\n```bash\n# find files for syntaxchecks\nregex_bash_files=\"^.*\\.sh$\"\nregex_php_files=\"^.*\\.(php|php.skel|php.skel.*)$\"\nregex_yaml_files=\"^.*\\.(yaml|yml)$\"\nregex_python_files=\"^.*\\.py$\"\nregex_ruby_files=\"^.*(\\.rb|Vagrantfile)$\"\nregex_crontab_files=\"^.*\\.cron$\"\n# exclude vendor and cache directories\nregex_exclude=\"^.*/(vendor|cache)/.*$\"\n```\n\n## Third party software\n\n- [chkcrontab](https://github.com/lyda/chkcrontab) - Modified to check crontabs without defiened user.\n\nExample crontab format:\n\n```bash\n# m h  dom mon dow   command\n0 5 * * 1 echo \"Hello world!\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneikei%2Fsyntaxchecks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneikei%2Fsyntaxchecks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneikei%2Fsyntaxchecks/lists"}