metadata-json-lint-3.0.0/0000755000175000017500000000000013767734463015071 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/0000755000175000017500000000000013767734463016233 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/types/0000755000175000017500000000000013767734463017377 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/types/metadata.json0000644000175000017500000000335313767734463022056 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "types": "balls", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/types/expected0000644000175000017500000000006113767734463021120 0ustar gabstergabsterDeprecated field 'types' found in metadata.json. metadata-json-lint-3.0.0/tests/types/Rakefile0000644000175000017500000000014613767734463021045 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/test.sh0000755000175000017500000001313513767734463017554 0ustar gabstergabster#!/bin/bash set -u # Ensure this can be called from outside its directory. cd $(dirname $0) SUCCESS=0 FAILURE=1 STATUS=0 fail() { echo $* STATUS=1 } # Tests the metadata-json-lint bin and if no additional arguments are given, also the rake task. test() { local name=$1; shift local expect=$1; shift test_bin $name $expect $* # Only check the Rakefile when no additional arguments were passed to metadata-json-lint. # In these cases, rake will likely have the opposite return code and cause false failures. if [ $# -eq 0 ]; then test_rake $name $expect metadata_lint fi } test_bin() { local name=$1; shift local expect=$1; shift local RESULT=-1 cd $name; bundle exec metadata-json-lint $* metadata.json >last_output 2>&1 RESULT=$? if [ $RESULT -ne $expect ]; then fail "Failing Test '${name}' (unexpected exit code '${RESULT}' instead of '${expect}') (bin)" echo " Note: you can examine '${name}/last_output' for any output" else # If the test is not expected to succeed then it should match an expected output if [ $expect -eq $SUCCESS ]; then echo "Successful Test '${name}' (bin)" else if [ -f expected ]; then if grep --quiet -f expected last_output; then echo "Successful Test '${name}' (bin)" else fail "Failing Test '${name}' (did not get expected output) (bin)" echo " Comparing '${name}/expected' with '${name}/last_output':" echo " Expected: '`cat expected`'" echo " Actual: '`cat last_output`'" fi else fail "Failing Test '${name}' (expected output file ${name}/expected is missing) (bin)" echo " Actual output that needs tested ('${name}/last_output'): '`cat last_output`'" fi fi fi cd .. } test_rake() { local name=$1; shift local expect=$1; shift local rake_task="${1-metadata_lint}" local RESULT=-1; cd $name; bundle exec rake $rake_task >last_rake_output 2>&1 RESULT=$? if [ $RESULT -ne $expect ]; then fail "Failing Test '${name}' (rake: ${rake_task})" else echo "Successful Test '${name}' (rake: ${rake_task})" fi; cd .. } # Run a broken one, expect FAILURE test "broken" $FAILURE # Run a perfect one, expect SUCCESS test "perfect" $SUCCESS # Run a broken one, expect FAILURE test "noname" $FAILURE # Run a broken one, expect FAILURE test "types" $FAILURE # Run a broken one, expect FAILURE test "multiple_problems" $FAILURE # Run a broken one, expect FAILURE test "duplicate-dep" $FAILURE # Run with --no-fail-on-warnings, expect SUCCESS test "duplicate-dep" $SUCCESS --no-fail-on-warnings # Run a broken one, expect FAILURE test "bad_license" $FAILURE # Run with --no-strict-license only, expect SUCCESS test "bad_license" $SUCCESS --no-strict-license # Run with --no-fail-on-warnings, expect SUCCESS test "bad_license" $SUCCESS --no-fail-on-warnings # Run a broken one, expect FAILURE test "long_summary" $FAILURE # Run a broken one, expect FAILURE test "mixed_version_syntax" $FAILURE # Run one with empty dependencies array, expect SUCCESS test "no_dependencies" $SUCCESS # Run one with open ended dependency, expect SUCCESS as strict deps is off by default test "open_ended_dependency" $SUCCESS # Run one with open ended dependency and --strict-dependencies, expect FAILURE test "open_ended_dependency" $FAILURE --strict-dependencies # Run one with open ended dependency and --strict-dependencies, but pass on warnings, expect SUCCESS test "open_ended_dependency" $SUCCESS --strict-dependencies --no-fail-on-warnings # Run one with missing version_requirement and --no-strict-dependency, expect SUCCESS test "missing_version_requirement" $SUCCESS # Run one with open ended dependency and --strict-dependencies, expect FAILURE test "missing_version_requirement" $FAILURE --strict-dependencies # Run one with open ended dependency and --strict-dependencies, but pass on warnings, expect SUCCESS test "missing_version_requirement" $SUCCESS --strict-dependencies --no-fail-on-warnings # Run test for "proprietary"-licensed modules, expect SUCCESS test "proprietary" $SUCCESS # Run without a metadata.json or Rakefile, expect FAILURE test "no_files" $FAILURE # Run with tags in an array in metadata.json, expect SUCCESS test "tags_with_array" $SUCCESS # Run with tags not in an array in metadata.json, expect FAILURE test "tags_no_array" $FAILURE # Run with json output format test "json_format" $FAILURE --format json # Run against a metadata.json with a string for the requirements test "non_array_requirements" $FAILURE # Run against a metadata.json with an unsupported minimum Puppet version for the requirements test "requirements_eol_version" $FAILURE --strict-puppet-version # Run a broken one, expect FAILURE test "duplicate-requirement" $FAILURE # Test running without specifying file to parse cd perfect bundle exec metadata-json-lint if [ $? -ne 0 ]; then fail "Failing Test 'running without specifying metadata.json' (bin)" else echo "Successful Test 'running without specifying metadata.json' (bin)" fi cd .. # Test changing the rake task using settings # The bin test will fail due to strict licensing # The rake test should pass due to licensing option being set in Rakefile test_bin "rake_global_options" $FAILURE test_rake "rake_global_options" $SUCCESS # Test multiple lints with different options test_rake "rake_multiple_json_options" $SUCCESS metadata_lint_multi # Test successful lint followed by further tasks test_rake "rake_chaining" $SUCCESS test if ! grep -qx "Successfully linted" rake_chaining/last_rake_output; then fail "Failing Test 'rake_chaining' failed to run second rake task" fi exit $STATUS metadata-json-lint-3.0.0/tests/tags_with_array/0000755000175000017500000000000013767734463021422 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/tags_with_array/metadata.json0000644000175000017500000000350313767734463024076 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "tags": ["postgres"], "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "1.2.3" }, { "name": "puppetlabs/apt", "version_requirement": "< 1.2.3" }, { "name": "puppetlabs/puppetdb", "version_requirement": "<= 1.2.3" }, { "name": "puppetlabs/vcsrepo", "version_requirement": ">= 1.0.0 < 2.0.0" }, { "name": "puppetlabs/rabbitmq", "version_requirement": "1.x" }, { "name": "puppetlabs/motd", "version_requirement": "1.2.x" } ] } metadata-json-lint-3.0.0/tests/tags_with_array/Rakefile0000644000175000017500000000014613767734463023070 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/tags_no_array/0000755000175000017500000000000013767734463021063 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/tags_no_array/metadata.json0000644000175000017500000000362213767734463023541 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "tags": "postgres", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "1.2.3" }, { "name": "puppetlabs/apt", "version_requirement": "< 1.2.3" }, { "name": "puppetlabs/puppetdb", "version_requirement": "<= 1.2.3" }, { "name": "puppetlabs/vcsrepo", "version_requirement": ">= 1.0.0 < 2.0.0" }, { "name": "puppetlabs/rabbitmq", "version_requirement": "1.x" }, { "name": "puppetlabs/motd", "version_requirement": "1.2.x" } ] } metadata-json-lint-3.0.0/tests/tags_no_array/expected0000644000175000017500000000013113767734463022602 0ustar gabstergabster(ERROR) tags: The property 'tags' of type string did not match the following type: array metadata-json-lint-3.0.0/tests/tags_no_array/Rakefile0000644000175000017500000000014613767734463022531 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/requirements_eol_version/0000755000175000017500000000000013767734463023362 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/requirements_eol_version/metadata.json0000644000175000017500000000350713767734463026042 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "tags": [ "postgres" ], "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.2.0" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "1.2.3" }, { "name": "puppetlabs/apt", "version_requirement": "< 1.2.3" }, { "name": "puppetlabs/puppetdb", "version_requirement": "<= 1.2.3" }, { "name": "puppetlabs/vcsrepo", "version_requirement": ">= 1.0.0 < 2.0.0" }, { "name": "puppetlabs/rabbitmq", "version_requirement": "1.x" }, { "name": "puppetlabs/motd", "version_requirement": "1.2.x" } ] } metadata-json-lint-3.0.0/tests/requirements_eol_version/expected0000644000175000017500000000031413767734463025104 0ustar gabstergabster(WARN) requirements: 3.2.0 is no longer supported. Minimum supported version is 4.10.0(WARN) requirement: 3.2.0 is no longer supported. Minimum supported version is 4.10.0 Warnings found in metadata.json metadata-json-lint-3.0.0/tests/requirements_eol_version/Rakefile0000644000175000017500000000014613767734463025030 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/rake_multiple_json_options/0000755000175000017500000000000013767734463023674 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/rake_multiple_json_options/metadata_ok.json0000644000175000017500000000305413767734463027042 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/rake_multiple_json_options/metadata_license.json0000644000175000017500000000306113767734463030051 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "invalid_license", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/rake_multiple_json_options/Rakefile0000644000175000017500000000072613767734463025346 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata_json_lint' MetadataJsonLint.options.fail_on_warnings = false desc "Test metadata_lint on multiple files. Don't fail" task :metadata_lint_multi do MetadataJsonLint.parse('metadata_license.json') do |options| options.strict_license = false end MetadataJsonLint.parse('metadata_ok.json') do |options| options.strict_license = true options.fail_on_warnings = true end end metadata-json-lint-3.0.0/tests/rake_global_options/0000755000175000017500000000000013767734463022250 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/rake_global_options/metadata.json0000644000175000017500000000306113767734463024723 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "invalid_license", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/rake_global_options/expected0000644000175000017500000000012613767734463023773 0ustar gabstergabsterLicense identifier invalid_license is not in the SPDX list: http://spdx.org/licenses/ metadata-json-lint-3.0.0/tests/rake_global_options/Rakefile0000644000175000017500000000031013767734463023707 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' MetadataJsonLint.options.strict_license = false MetadataJsonLint.options.fail_on_warnings = false metadata-json-lint-3.0.0/tests/rake_chaining/0000755000175000017500000000000013767734463021015 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/rake_chaining/metadata.json0000644000175000017500000000345313767734463023475 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "1.2.3" }, { "name": "puppetlabs/apt", "version_requirement": "< 1.2.3" }, { "name": "puppetlabs/puppetdb", "version_requirement": "<= 1.2.3" }, { "name": "puppetlabs/vcsrepo", "version_requirement": ">= 1.0.0 < 2.0.0" }, { "name": "puppetlabs/rabbitmq", "version_requirement": "1.x" }, { "name": "puppetlabs/motd", "version_requirement": "1.2.x" } ] } metadata-json-lint-3.0.0/tests/rake_chaining/Rakefile0000644000175000017500000000030113767734463022454 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' task :test => %i[metadata_lint success] task :success do puts 'Successfully linted' end metadata-json-lint-3.0.0/tests/proprietary/0000755000175000017500000000000013767734463020613 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/proprietary/metadata.json0000644000175000017500000000305513767734463023271 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "proprietary", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/proprietary/Rakefile0000644000175000017500000000014613767734463022261 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/perfect/0000755000175000017500000000000013767734463017663 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/perfect/metadata.json0000644000175000017500000000345313767734463022343 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "1.2.3" }, { "name": "puppetlabs/apt", "version_requirement": "< 1.2.3" }, { "name": "puppetlabs/puppetdb", "version_requirement": "<= 1.2.3" }, { "name": "puppetlabs/vcsrepo", "version_requirement": ">= 1.0.0 < 2.0.0" }, { "name": "puppetlabs/rabbitmq", "version_requirement": "1.x" }, { "name": "puppetlabs/motd", "version_requirement": "1.2.x" } ] } metadata-json-lint-3.0.0/tests/perfect/Rakefile0000644000175000017500000000014613767734463021331 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/open_ended_dependency/0000755000175000017500000000000013767734463022531 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/open_ended_dependency/metadata.json0000644000175000017500000000132513767734463025205 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "7" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 3.2.0" } ] } metadata-json-lint-3.0.0/tests/open_ended_dependency/expected0000644000175000017500000000012713767734463024255 0ustar gabstergabsterDependency puppetlabs/stdlib has an open ended dependency version requirement >= 3.2.0 metadata-json-lint-3.0.0/tests/open_ended_dependency/Rakefile0000644000175000017500000000014613767734463024177 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/noname/0000755000175000017500000000000013767734463017510 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/noname/metadata.json0000644000175000017500000000326413767734463022170 0ustar gabstergabster{ "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/noname/expected0000644000175000017500000000012013767734463021225 0ustar gabstergabster(ERROR) required_fields: The file did not contain a required property of 'name' metadata-json-lint-3.0.0/tests/noname/Rakefile0000644000175000017500000000014613767734463021156 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/non_array_requirements/0000755000175000017500000000000013767734463023026 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/non_array_requirements/metadata.json0000644000175000017500000000232713767734463025505 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": "aoeu", "dependencies": [] } metadata-json-lint-3.0.0/tests/non_array_requirements/expected0000644000175000017500000000015113767734463024547 0ustar gabstergabster(ERROR) requirements: The property 'requirements' of type string did not match the following type: array metadata-json-lint-3.0.0/tests/non_array_requirements/Rakefile0000644000175000017500000000014613767734463024474 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/no_version_range/0000755000175000017500000000000013767734463021570 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/no_version_range/metadata.json0000644000175000017500000000144013767734463024242 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "7" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_range": ">= 1.0.0" } ] } metadata-json-lint-3.0.0/tests/no_version_range/Rakefile0000644000175000017500000000014613767734463023236 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/no_pe/0000755000175000017500000000000013767734463017333 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/no_pe/metadata.json0000644000175000017500000000136313767734463022011 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "7" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib" } ] } metadata-json-lint-3.0.0/tests/no_pe/Rakefile0000644000175000017500000000014613767734463021001 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/no_files/0000755000175000017500000000000013767734463020031 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/no_files/expected0000644000175000017500000000007713767734463021561 0ustar gabstergabsterError: Unable to read metadata file: No such file or directory metadata-json-lint-3.0.0/tests/no_files/.gitkeep0000644000175000017500000000000013767734463021450 0ustar gabstergabstermetadata-json-lint-3.0.0/tests/no_dependencies/0000755000175000017500000000000013767734463021355 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/no_dependencies/metadata.json0000644000175000017500000000243513767734463024034 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [] } metadata-json-lint-3.0.0/tests/no_dependencies/Rakefile0000644000175000017500000000014613767734463023023 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/multiple_problems/0000755000175000017500000000000013767734463021771 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/multiple_problems/metadata.json0000644000175000017500000000323613767734463024450 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "types": "stuff", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/multiple_problems/expected0000644000175000017500000000023313767734463023513 0ustar gabstergabsterRequired field 'license' not found in metadata.json. Required field 'summary' not found in metadata.json. Deprecated field 'types' found in metadata.json. metadata-json-lint-3.0.0/tests/multiple_problems/Rakefile0000644000175000017500000000014613767734463023437 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/mixed_version_syntax/0000755000175000017500000000000013767734463022514 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/mixed_version_syntax/metadata.json0000644000175000017500000000132513767734463025170 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "7" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 3.2.x" } ] } metadata-json-lint-3.0.0/tests/mixed_version_syntax/expected0000644000175000017500000000024713767734463024243 0ustar gabstergabster(WARN) dependencies: Mixing "x" or "\*" version syntax with operators is not recommended in metadata.json, use one style in the puppetlabs/stdlib dependency: >= 3.2.x metadata-json-lint-3.0.0/tests/mixed_version_syntax/Rakefile0000644000175000017500000000014613767734463024162 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/missing_version_requirement/0000755000175000017500000000000013767734463024071 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/missing_version_requirement/metadata.json0000644000175000017500000000124213767734463026543 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "7" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib" } ] } metadata-json-lint-3.0.0/tests/missing_version_requirement/expected0000644000175000017500000000011613767734463025613 0ustar gabstergabsterDependency puppetlabs/stdlib has an open ended dependency version requirement metadata-json-lint-3.0.0/tests/missing_version_requirement/Rakefile0000644000175000017500000000014613767734463025537 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/long_summary/0000755000175000017500000000000013767734463020747 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/long_summary/metadata.json0000644000175000017500000000102113767734463023414 0ustar gabstergabster{ "name": "foo-bar", "version": "1.0.0", "author": "foo/bar", "summary": "This is obviously a way way tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long", "license": "Apache-2.0", "source": "", "project_page": "", "issues_url": "", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] } ], "requirements": [ ], "dependencies": [ ] } metadata-json-lint-3.0.0/tests/long_summary/expected0000644000175000017500000000012213767734463022466 0ustar gabstergabster(ERROR) summary: The property 'summary' was not of a maximum string length of 144 metadata-json-lint-3.0.0/tests/long_summary/Rakefile0000644000175000017500000000014613767734463022415 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/json_format/0000755000175000017500000000000013767734463020554 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/json_format/metadata.json0000644000175000017500000000321613767734463023231 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Unknown-1.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4 <1.0.0" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/json_format/expected0000644000175000017500000000017513767734463022303 0ustar gabstergabster"warnings":\[{"check":"license","msg":"License identifier Unknown-1.0 is not in the SPDX list: http://spdx.org/licenses/"}\] metadata-json-lint-3.0.0/tests/json_format/Rakefile0000644000175000017500000000014613767734463022222 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/duplicate-requirement/0000755000175000017500000000000013767734463022543 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/duplicate-requirement/metadata.json0000644000175000017500000000332313767734463025217 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "5.5.1" }, { "name": "puppet", "version_requirement": "6.11.0" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/duplicate-requirement/expected0000644000175000017500000000010413767734463024262 0ustar gabstergabsterDuplicate entries in the 'requirements' list with the name 'puppet' metadata-json-lint-3.0.0/tests/duplicate-requirement/Rakefile0000644000175000017500000000014613767734463024211 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/duplicate-dep/0000755000175000017500000000000013767734463020753 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/duplicate-dep/metadata.json0000644000175000017500000000333313767734463023430 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "5.5.1" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/duplicate-dep/expected0000644000175000017500000000005413767734463022476 0ustar gabstergabsterDuplicate dependencies on puppetlabs/stdlib metadata-json-lint-3.0.0/tests/duplicate-dep/Rakefile0000644000175000017500000000014613767734463022421 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/broken/0000755000175000017500000000000013767734463017513 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/broken/metadata.json0000644000175000017500000000332613767734463022172 0ustar gabstergabster{ "name": "puppetlabs-postgresql" "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/broken/expected0000644000175000017500000000010213767734463021230 0ustar gabstergabsterError: Unable to parse metadata.json: [0-9]*: unexpected token at metadata-json-lint-3.0.0/tests/broken/Rakefile0000644000175000017500000000014613767734463021161 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/tests/bad_license/0000755000175000017500000000000013767734463020463 5ustar gabstergabstermetadata-json-lint-3.0.0/tests/bad_license/metadata.json0000644000175000017500000000321613767734463023140 0ustar gabstergabster{ "name": "puppetlabs-postgresql", "version": "3.4.1", "author": "Inkling/Puppet Labs", "summary": "PostgreSQL defined resource types", "license": "Unknown-1.0", "source": "git://github.com/puppetlabs/puppet-postgresql.git", "project_page": "https://github.com/puppetlabs/puppet-postgresql", "issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", "12.04", "14.04" ] } ], "requirements": [ { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": "4.x" }, { "name": "puppetlabs/firewall", "version_requirement": ">= 0.0.4 <1.0.0" }, { "name": "puppetlabs/apt", "version_requirement": ">=1.1.0 <2.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.1.0 <2.0.0" } ] } metadata-json-lint-3.0.0/tests/bad_license/expected0000644000175000017500000000012213767734463022202 0ustar gabstergabsterLicense identifier Unknown-1.0 is not in the SPDX list: http://spdx.org/licenses/ metadata-json-lint-3.0.0/tests/bad_license/Rakefile0000644000175000017500000000014613767734463022131 0ustar gabstergabster$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) require 'metadata-json-lint/rake_task' metadata-json-lint-3.0.0/spec/0000755000175000017500000000000013767734463016023 5ustar gabstergabstermetadata-json-lint-3.0.0/spec/version_requirement_spec.rb0000644000175000017500000000270413767734463023472 0ustar gabstergabsterdescribe MetadataJsonLint::VersionRequirement do describe '.new' do it { expect(described_class.new('')).to be_a(MetadataJsonLint::VersionRequirement) } it { expect(described_class.new('>= 1.0')).to be_a(MetadataJsonLint::VersionRequirement) } it { expect { described_class.new('## 1.0') }.to raise_error(ArgumentError) } end describe '#mixed_syntax?' do it { expect(described_class.new('>= 1.0.0').mixed_syntax?).to be false } it { expect(described_class.new('1.0.x').mixed_syntax?).to be false } it { expect(described_class.new('>= 1.0.0 < 2.0').mixed_syntax?).to be false } it { expect(described_class.new('< 2.0').mixed_syntax?).to be false } it { expect(described_class.new('>= 1.0.x').mixed_syntax?).to be true } it { expect(described_class.new('>= 1.0.*').mixed_syntax?).to be true } it { expect(described_class.new('>= 1.x').mixed_syntax?).to be true } it { expect(described_class.new('>= 1.x.x').mixed_syntax?).to be true } it { expect(described_class.new('>= 1.*').mixed_syntax?).to be true } it { expect(described_class.new('>= 1.0.0 < 2.x').mixed_syntax?).to be true } it { expect(described_class.new('<2.x').mixed_syntax?).to be true } end describe '#open_ended?' do it { expect(described_class.new('>= 1.0 < 2.0').open_ended?).to be false } it { expect(described_class.new('>= 1.0').open_ended?).to be true } it { expect(described_class.new('').open_ended?).to be true } end end metadata-json-lint-3.0.0/spec/spec_helper.rb0000644000175000017500000000322713767734463020645 0ustar gabstergabsterrequire 'metadata_json_lint' # This file was generated by the `rspec --init` command # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. config.expect_with :rspec do |expectations| # This option will default to `true` in RSpec 4. It makes the `description` # and `failure_message` of custom matchers include text for helper methods # defined using `chain`, e.g.: # be_bigger_than(2).and_smaller_than(4).description # # => "be bigger than 2 and smaller than 4" # ...rather than: # # => "be bigger than 2" expectations.include_chain_clauses_in_custom_matcher_descriptions = true end # rspec-mocks config goes here. You can use an alternate test double # library (such as bogus or mocha) by changing the `mock_with` option here. config.mock_with :rspec do |mocks| # Prevents you from mocking or stubbing a method that does not exist on # a real object. This is generally recommended, and will default to # `true` in RSpec 4. mocks.verify_partial_doubles = true end # This option will default to `:apply_to_host_groups` in RSpec 4 (and will # have no way to turn it off -- the option exists only for backwards # compatibility in RSpec 3). It causes shared context metadata to be # inherited by the metadata hash of host groups and examples, rather than # triggering implicit auto-inclusion in groups with matching metadata. config.shared_context_metadata_behavior = :apply_to_host_groups end metadata-json-lint-3.0.0/spec/schema_spec.rb0000644000175000017500000000321013767734463020616 0ustar gabstergabsterdescribe MetadataJsonLint::Schema do describe '#schema' do it { expect(subject.schema).to be_a(Hash) } end describe '#validate' do let(:minimal) { { author: '', dependencies: [], license: 'A', name: 'a-a', source: '', summary: '', version: '1.0.0' } } context 'with empty hash' do subject { described_class.new.validate({}) } it { is_expected.to be_a(Array) } it { expect(subject.size).to eq(7) } it { is_expected.to include(field: 'root', message: "The file did not contain a required property of 'author'") } end context 'with minimal entries' do subject { described_class.new.validate(minimal) } it { is_expected.to eq([]) } end context 'with validation error on entry' do subject { described_class.new.validate(minimal.merge(summary: 'A' * 145)) } it { is_expected.to eq([{ field: 'summary', message: "The property 'summary' was not of a maximum string length of 144" }]) } end context 'with validation error on nested entry' do subject { described_class.new.validate(minimal.merge(dependencies: [{ name: 'in###id' }])) } it { expect(subject.size).to eq(1) } it { is_expected.to include(field: 'dependencies', message: a_string_matching(%r{The property 'dependencies/0/name' value "in###id" did not match the regex})) } end context 'with semver validation failure' do subject { described_class.new.validate(minimal.merge(version: 'a')) } it { expect(subject.size).to eq(1) } it { is_expected.to include(field: 'version', message: a_string_matching(/The property 'version' must be a valid semantic version/)) } end end end metadata-json-lint-3.0.0/spec/metadata_json_lint_spec.rb0000644000175000017500000000207013767734463023220 0ustar gabstergabsterdescribe MetadataJsonLint do describe '.validate_requirements!' do context 'empty requirements' do let :requirements do [] end it { expect { described_class.validate_requirements!(requirements) }.not_to raise_error } end context 'with pe' do let :requirements do [ { 'name' => 'pe' } ] end it do expect(described_class).to receive('warn').with(:requirements, "The 'pe' requirement is no longer supported by the Forge.") expect { described_class.validate_requirements!(requirements) }.not_to raise_error end end context 'with invalid requirement' do let :requirements do [ { 'name' => 'puppet', 'version_requirement' => 'a' } ] end it do expect(described_class).to receive('error').with(:requirements, "Invalid 'version_requirement' field in metadata.json: Unparsable version range: \"a\"") expect { described_class.validate_requirements!(requirements) }.not_to raise_error end end end end metadata-json-lint-3.0.0/metadata-json-lint.gemspec0000644000175000017500000000172113767734463022132 0ustar gabstergabsterrequire 'date' Gem::Specification.new do |s| s.name = 'metadata-json-lint' s.version = '3.0.0' s.date = Date.today.to_s s.summary = 'metadata-json-lint /path/to/metadata.json' s.description = 'Utility to verify Puppet metadata.json files' s.authors = ['Vox Pupuli'] s.email = 'voxpupuli@groups.io' s.files = `git ls-files -z`.split("\x0") s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } s.test_files = s.files.grep(%r{^(tests|spec)/}) s.homepage = 'http://github.com/voxpupuli/metadata-json-lint' s.license = 'Apache-2.0' s.required_ruby_version = '>= 2.1.0' s.add_runtime_dependency 'spdx-licenses', '~> 1.0' s.add_runtime_dependency 'json-schema', '~> 2.8' s.add_development_dependency 'pry' s.add_development_dependency 'rake' s.add_development_dependency 'semantic_puppet' s.add_development_dependency 'rspec' s.add_development_dependency 'rubocop', '~> 0.50.0' end metadata-json-lint-3.0.0/lib/0000755000175000017500000000000013767734463015637 5ustar gabstergabstermetadata-json-lint-3.0.0/lib/metadata_json_lint.rb0000644000175000017500000002124613767734463022030 0ustar gabstergabsterrequire 'json' require 'spdx-licenses' require 'optparse' require 'metadata-json-lint/semantic_puppet_loader' MetadataJsonLint::SemanticPuppetLoader.try_load require 'metadata-json-lint/schema' require 'metadata-json-lint/version_requirement' module MetadataJsonLint MIN_PUPPET_VER = '4.10.0'.freeze def options @options ||= Struct.new( :fail_on_warnings, :strict_license, :strict_dependencies, :strict_puppet_version, :format ).new( true, # fail_on_warnings true, # strict_license false, # strict_dependencies false, # strict_puppet_version 'text', # format ) end module_function :options def run OptionParser.new do |opts| opts.banner = 'Usage: metadata-json-lint [options] [metadata.json]' opts.on('--[no-]strict-dependencies', "Fail on open-ended module version dependencies. Defaults to '#{options[:strict_dependencies]}'.") do |v| options[:strict_dependencies] = v end opts.on('--[no-]strict-license', "Don't fail on strict license check. Defaults to '#{options[:strict_license]}'.") do |v| options[:strict_license] = v end opts.on('--[no-]fail-on-warnings', "Fail on any warnings. Defaults to '#{options[:fail_on_warnings]}'.") do |v| options[:fail_on_warnings] = v end opts.on('--[no-]strict-puppet-version', "Fail on strict Puppet Version check based on current supported Puppet versions. Defaults to '#{options[:strict_puppet_version]}'.") do |v| options[:strict_puppet_version] = v end opts.on('-f', '--format FORMAT', %i[text json], 'The format in which results will be output (text, json)') do |format| options[:format] = format end end.parse! mj = if ARGV[0].nil? if File.readable?('metadata.json') 'metadata.json' else abort('Error: metadata.json is not readable or does not exist.') end else ARGV[0] end exit(MetadataJsonLint.parse(mj) ? 0 : 1) end module_function :run def parse(metadata) @errors = [] @warnings = [] # Small hack to use the module settings as defaults but allow overriding for different rake tasks options = options().clone # Configuration from rake tasks yield options if block_given? begin f = File.read(metadata) rescue Exception => e abort("Error: Unable to read metadata file: #{e.exception}") end begin parsed = JSON.parse(f) rescue Exception => e abort("Error: Unable to parse metadata.json: #{e.exception}") end # Validate basic structure against JSON schema schema_errors = Schema.new.validate(parsed) schema_errors.each do |err| error (err[:field] == 'root' ? :required_fields : err[:field]), err[:message] end validate_dependencies!(parsed['dependencies']) if parsed['dependencies'] # Deprecated fields # From: https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#write-a-metadatajson-file deprecated_fields = %w[types checksum] deprecated_fields.each do |field| unless parsed[field].nil? error :deprecated_fields, "Deprecated field '#{field}' found in metadata.json." end end # The nested 'requirements' name of 'pe' is deprecated as well. # https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/puppet-users/nkRPvG4q0Oo/GmXa109aJQAJ validate_requirements!(parsed['requirements']) if parsed['requirements'] # Shoulds/recommendations # From: https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#write-a-metadatajson-file # if options[:strict_license] && !parsed['license'].nil? && !SpdxLicenses.exist?(parsed['license']) && parsed['license'] != 'proprietary' msg = "License identifier #{parsed['license']} is not in the SPDX list: http://spdx.org/licenses/" warn(:license, msg) end if !@errors.empty? || !@warnings.empty? result = @errors.empty? ? "Warnings found in #{metadata}" : "Errors found in #{metadata}" case options[:format] when :json puts JSON.fast_generate(:result => result, :warnings => @warnings, :errors => @errors) else @warnings.each { |warn| puts "(WARN) #{warn}" } @errors.each { |err| puts "(ERROR) #{err}" } puts result end if !@errors.empty? || (!@warnings.empty? && (options[:fail_on_warnings] == true)) return false end end true end module_function :parse def validate_requirements_unique(requirements) names = requirements.map { |x| x['name'] } counts = Hash.new(0) names.each { |name| counts[name.downcase] += 1 } counts.each do |k, v| error :requirements, "Duplicate entries in the 'requirements' list with the name '#{k}'" if v > 1 end end module_function :validate_requirements_unique def validate_requirements!(requirements) return unless requirements.is_a?(Array) requirements.each do |requirement| if requirement['name'] == 'pe' warn :requirements, "The 'pe' requirement is no longer supported by the Forge." end begin puppet_req = VersionRequirement.new(requirement.fetch('version_requirement', '')) rescue ArgumentError => e # Raised when the version_requirement provided could not be parsed error :requirements, "Invalid 'version_requirement' field in metadata.json: #{e}" end validate_puppet_ver!(puppet_req) unless puppet_req.instance_variable_get('@requirement').nil? end validate_requirements_unique(requirements) end module_function :validate_requirements! def validate_puppet_ver!(requirement) if options[:strict_puppet_version] && requirement.open_ended? warn(:requirement, "Puppet has an open ended version requirement #{requirement.ver_range}") end if options[:strict_puppet_version] && requirement.puppet_eol? warn(:requirement, "#{requirement.min} is no longer supported. Minimum supported version is #{MIN_PUPPET_VER}") end return unless requirement.mixed_syntax? warn(:requirement, 'Mixing "x" or "*" version syntax with operators is not recommended in ' \ "metadata.json, use one style in the puppet version: #{requirement.instance_variable_get('@requirement')}") end module_function :validate_puppet_ver! def validate_dependencies!(deps) dep_names = [] deps.each do |dep| if dep_names.include?(dep['name']) warn :dependencies, "Duplicate dependencies on #{dep['name']}" end dep_names << dep['name'] begin requirement = VersionRequirement.new(dep.fetch('version_requirement', '')) rescue ArgumentError => e # Raised when the version_requirement provided could not be parsed error :dependencies, "Invalid 'version_requirement' field in metadata.json: #{e}" # Skip to the next dependency next end validate_version_requirement!(dep, requirement) # 'version_range' is no longer used by the forge # See https://tickets.puppetlabs.com/browse/PUP-2781 if dep.key?('version_range') warn :dependencies, "Dependency #{dep['name']} has a 'version_range' attribute " \ 'which is no longer used by the forge.' end end end module_function :validate_dependencies! def validate_version_requirement!(dep, requirement) # Open ended dependency # From: https://docs.puppet.com/puppet/latest/reference/modules_metadata.html#best-practice-set-an-upper-bound-for-dependencies if options[:strict_dependencies] && requirement.open_ended? msg = "Dependency #{dep['name']} has an open " \ "ended dependency version requirement #{dep['version_requirement']}" warn(:dependencies, msg) end # Mixing operator and wildcard version syntax # From: https://docs.puppet.com/puppet/latest/modules_metadata.html#version-specifiers # Supported in Puppet 5 and higher, but the syntax is unclear and incompatible with older versions return unless requirement.mixed_syntax? warn(:dependencies, 'Mixing "x" or "*" version syntax with operators is not recommended in ' \ "metadata.json, use one style in the #{dep['name']} dependency: #{dep['version_requirement']}") end module_function :validate_version_requirement! def format_error(check, msg) case options[:format] when :json { :check => check, :msg => msg } else "#{check}: #{msg}" end end module_function :format_error def warn(check, msg) @warnings ||= [] @warnings << format_error(check, msg) end module_function :warn def error(check, msg) @errors ||= [] @errors << format_error(check, msg) end module_function :error end metadata-json-lint-3.0.0/lib/metadata-json-lint/0000755000175000017500000000000013767734463021332 5ustar gabstergabstermetadata-json-lint-3.0.0/lib/metadata-json-lint/version_requirement.rb0000644000175000017500000000365213767734463025772 0ustar gabstergabstermodule MetadataJsonLint # Parses a string module version requirement with semantic_puppet and # provides methods to analyse it for lint warnings class VersionRequirement def initialize(requirement) @requirement = requirement if defined?(SemanticPuppet::VersionRange) @range = SemanticPuppet::VersionRange.parse(requirement) raise ArgumentError, "Range matches no versions: \"#{requirement}\"" if @range == SemanticPuppet::VersionRange::EMPTY_RANGE elsif requirement.match(/\A[a-z0-9*.\-^~><=|\t ]*\Z/i).nil? raise ArgumentError, "Unparsable version range: \"#{requirement}\"" end end # Whether the range uses a comparison operator (e.g. >=) with a wildcard # syntax, such as ">= 1.x" or "< 2.0.x" def mixed_syntax? !/ [><=^~]{1,2} # comparison operators \s* \d\. # MAJOR (?: (?:x|\*) # MINOR is wildcard | \d\.(?:x|\*) # MINOR is digit and PATCH is wildcard ) /x.match(requirement).nil? end def open_ended? if range range.end == SemanticPuppet::Version::MAX else # Empty requirement strings are open-ended. return true if requirement.strip.empty? # Strip superfluous whitespace. range_set = requirement.gsub(/([><=~^])(?:\s+|\s*v)/, '\1') # Split on logical OR ranges = range_set.split(/\s*\|\|\s*/) # Returns true if any range includes a '>' but not a corresponding '<' # which should be the only way to declare an open-ended range. ranges.select { |r| r.include?('>') }.any? { |r| !r.include?('<') } end end def puppet_eol? true if range.begin < SemanticPuppet::Version.parse(MIN_PUPPET_VER) end def ver_range range end def min range.begin end def max range.end end private attr_reader :range, :requirement end end metadata-json-lint-3.0.0/lib/metadata-json-lint/semantic_puppet_loader.rb0000644000175000017500000000264413767734463026413 0ustar gabstergabstermodule MetadataJsonLint # Attempts the various methods of loading SemanticPuppet. module SemanticPuppetLoader def try_load try_load_puppet return if defined?(SemanticPuppet) try_load_semantic return if defined?(SemanticPuppet) try_load_semantic_puppet return if defined?(SemanticPuppet) warn 'Could not find semantic_puppet gem, falling back to internal functionality. Version checks may be less robust.' end module_function :try_load # Most modern Puppet versions have SemanticPuppet vendored in the proper # namespace and automatically load it at require time. def try_load_puppet require 'puppet' rescue LoadError nil end module_function :try_load_puppet # Older Puppet 4.x versions have SemanticPuppet vendored but under the # Semantic namespace and require it on demand, so we need to load it # ourselves and then alias it to SemanticPuppet for convenience. def try_load_semantic require 'semantic' Kernel.const_set('SemanticPuppet', Semantic) rescue LoadError nil end module_function :try_load_semantic # If Puppet is not available or is a version that does not have # SemanticPuppet vendored, try to load the external gem. def try_load_semantic_puppet require 'semantic_puppet' rescue LoadError nil end module_function :try_load_semantic_puppet end end metadata-json-lint-3.0.0/lib/metadata-json-lint/schema.rb0000644000175000017500000001210713767734463023120 0ustar gabstergabsterrequire 'json-schema' module MetadataJsonLint # Provides validation of metadata.json against a JSON schema document # maintained in this class. Provides a good first pass over the metadata with # type checking and basic format/length validations. # # rubocop:disable Metrics/ClassLength # schema data structure is quite large class Schema # Based on https://docs.puppet.com/puppet/latest/modules_metadata.html # # rubocop:disable Style/TrailingCommaInLiteral # easier to modify individual lines def schema { '$schema' => 'http://json-schema.org/draft-04/schema#', 'properties' => { 'author' => { 'type' => 'string', }, 'data_provider' => { 'type' => %w[null string], }, 'dependencies' => { 'type' => 'array', 'items' => { 'properties' => { 'name' => { 'type' => 'string', 'pattern' => '^\w+[/-][a-z][a-z0-9_]*$', }, 'version_requirement' => { 'type' => 'string', }, }, 'required' => %w[ name ], }, }, 'description' => { 'type' => 'string', }, 'issues_url' => { 'type' => 'string', 'format' => 'uri', }, 'license' => { 'type' => 'string', }, 'operatingsystem_support' => { 'type' => 'array', 'items' => { 'properties' => { 'operatingsystem' => { 'type' => 'string', }, 'operatingsystemrelease' => { 'type' => 'array', 'items' => { 'type' => 'string', }, }, }, 'required' => %w[ operatingsystem ], }, }, 'name' => { 'type' => 'string', 'pattern' => '^\w+-[a-z][a-z0-9_]*$', }, 'project_page' => { 'type' => 'string', 'format' => 'uri', }, # Undocumented but in use: https://tickets.puppetlabs.com/browse/DOCUMENT-387 'requirements' => { 'type' => 'array', 'items' => { 'properties' => { 'name' => { 'type' => 'string', }, 'version_requirement' => { 'type' => 'string', }, }, 'required' => %w[ name ], }, }, 'source' => { 'type' => 'string', }, 'summary' => { 'type' => 'string', 'maxLength' => 144, }, 'tags' => { 'type' => 'array', 'items' => { 'type' => 'string' }, }, 'version' => { 'type' => 'string', 'format' => 'semver', }, }, # from https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#write-a-metadatajson-file 'required' => %w[ author dependencies license name source summary version ], } end # rubocop:enable Style/TrailingCommaInLiteral def validate(data, options = {}) JSON::Validator.register_format_validator('semver', method(:semver_validator)) JSON::Validator.fully_validate(schema, data, options.merge(errors_as_objects: true)).map do |error| field = error[:fragment].split('/')[1] field = 'root' if field.nil? || field.empty? message = error[:message] .sub(/ in schema [\w-]+/, '') # remove schema UUID, not needed in output .sub(%r{'#/}, "'") # remove root #/ prefix from document paths .sub("property ''", 'file') # call the root #/ node the file { field: field, message: message } end end private def semver_full_regex @semver_full_regex ||= begin # Version string matching regexes numeric = '(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)' # Major . Minor . Patch pre = '(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?' # Prerelease build = '(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?' # Build full = numeric + pre + build /\A#{full}\Z/ end end def semver_validator(value) if defined?(SemanticPuppet::Version) begin SemanticPuppet::Version.parse(value) rescue SemanticPuppet::Version::ValidationFailure => e raise JSON::Schema::CustomFormatError, "must be a valid semantic version: #{e.message}" end elsif value.match(semver_full_regex).nil? raise JSON::Schema::CustomFormatError, "must be a valid semantic version: Unable to parse '#{value}' as a semantic version identifier" end end end end metadata-json-lint-3.0.0/lib/metadata-json-lint/rake_task.rb0000644000175000017500000000035513767734463023626 0ustar gabstergabsterrequire 'rake' require 'rake/tasklib' require 'metadata_json_lint' require 'json' desc 'Run metadata-json-lint' task :metadata_lint do if File.exist?('metadata.json') abort unless MetadataJsonLint.parse('metadata.json') end end metadata-json-lint-3.0.0/bin/0000755000175000017500000000000013767734463015641 5ustar gabstergabstermetadata-json-lint-3.0.0/bin/metadata-json-lint0000755000175000017500000000025713767734463021266 0ustar gabstergabster#!/usr/bin/env ruby lib = File.expand_path('../../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'metadata_json_lint' MetadataJsonLint.run metadata-json-lint-3.0.0/Rakefile0000644000175000017500000000164113767734463016540 0ustar gabstergabsterdesc 'Run all tests' task :test => %i[rubocop spec test:acceptance] require 'rubocop/rake_task' RuboCop::RakeTask.new namespace :test do desc 'Acceptance suite under test/ which runs metadata-json-lint against sample files with expected output' task :acceptance do sh 'tests/test.sh' end end require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) begin require 'github_changelog_generator/task' GitHubChangelogGenerator::RakeTask.new :changelog do |config| config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file." config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog] config.user = 'voxpupuli' config.project = 'metadata-json-lint' config.future_release = "v#{Gem::Specification.load("#{config.project}.gemspec").version}" end rescue LoadError puts 'no github_changelog_generator gem available' end metadata-json-lint-3.0.0/README.md0000644000175000017500000000711713767734463016356 0ustar gabstergabster# metadata-json-lint The metadata-json-lint tool validates and lints `metadata.json` files in Puppet modules against style guidelines from the [Puppet Forge module metadata](https://docs.puppet.com/puppet/latest/modules_publishing.html#write-a-metadatajson-file) recommendations. ## Compatibility metadata-json-lint is compatible with Ruby versions 2.0.0, 2.1.9, 2.3.1, and 2.4.1. ## Installation via `gem` command: ``` shell gem install metadata-json-lint ``` via Gemfile: ``` ruby gem 'metadata-json-lint' ``` ## Usage ### Testing with metadata-json-lint On the command line, run `metadata-json-lint` with the path of your `metadata.json` file: ```shell metadata-json-lint /path/to/metadata.json ``` ### Testing with metadata-json-lint as a Rake task If you are already using `puppet_spec_helper`, the 'validate' task already includes `metadata-json-lint`. You can also integrate `metadata-json-lint` checks into your tests using the Rake task. Add `require 'metadata-json-lint/rake_task'` to your `Rakefile`, and then run: ```ruby rake metadata_lint ``` To set options for the Rake task, include them when you define the task: ```ruby require 'metadata_json_lint' task :metadata_lint do MetadataJsonLint.parse('metadata.json') do |options| options.strict_license = false end end ``` Alternatively, set the option after requiring the Rake task: ```ruby require 'metadata-json-lint/rake_task' MetadataJsonLint.options.strict_license = false ``` ### Options * `--[no-]strict-dependencies`: Whether to fail if module version dependencies are open-ended. Defaults to `false`. * `--[no-]strict-license`: Whether to fail on strict license check. Defaults to `true`. * `--[no-]fail-on-warnings`: Whether to fail on warnings. Defaults to `true`. * `--[no-]strict-puppet-version`: Whether to fail if Puppet version requirements are open-ended or no longer supported. Defaults to `false`. ## Contributors A big thank you to the [contributors](https://github.com/voxpupuli/metadata-json-lint/graphs/contributors). ## Making a new release How to make a new release? * update the gemspec file with the desired version ```console $ git diff diff --git a/metadata-json-lint.gemspec b/metadata-json-lint.gemspec index c86668e..6a3ad38 100644 --- a/metadata-json-lint.gemspec +++ b/metadata-json-lint.gemspec @@ -2,7 +2,7 @@ require 'date' Gem::Specification.new do |s| s.name = 'metadata-json-lint' - s.version = '2.4.0' + s.version = '2.5.0' s.date = Date.today.to_s s.summary = 'metadata-json-lint /path/to/metadata.json' s.description = 'Utility to verify Puppet metadata.json files' ``` * export a GitHub access token as environment variable: ```console export CHANGELOG_GITHUB_TOKEN=*token* ``` * Install deps and generate the changelog ```console $ bundle install --path .vendor/ --jobs=$(nproc) --with release $ bundle exec rake changelog Found 25 tags Fetching tags dates: 25/25 Sorting tags... Received issues: 103 Pull Request count: 77 Filtered pull requests: 72 Filtered issues: 26 Fetching events for issues and PR: 98 Fetching closed dates for issues: 98/98 Fetching SHAs for tags: 25 Associating PRs with tags: 72/72 Generating entry... Done! Generated log placed in ~/metadata-json-lint/CHANGELOG.md ``` * Check the diff for `CHANGELOG.md`. Does it contain a breaking change but the new version is only a minor bump? Does the new release only contains bug fixes? Adjust the version properly while honouring semantic versioning. If required, regenerate the `CHANGELOG.md`. Afterwards submit it as a PR. * If it gets approved, merge the PR, create a git tag on that and push it. metadata-json-lint-3.0.0/LICENSE0000644000175000017500000002375513767734463016112 0ustar gabstergabsterCopyright 2014 HP Development Corporation L.P. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS metadata-json-lint-3.0.0/HISTORY.md0000644000175000017500000000765013767734463016564 0ustar gabstergabster## 2.3.0 * Add duplicate testing in requirements list * Fix wrong license file content so GitHub can properly detect it * Fix a typo in the README.md ## 2.2.0 * Validate Puppet version_requirement [#99](https://github.com/voxpupuli/metadata-json-lint/issues/99) * Add optional check `--strict-puppet-version` to validate the Puppet Agent Version is not EOL or open ended [#100](https://github.com/voxpupuli/metadata-json-lint/pull/100) ## 2.1.0 ### Changes * Improve rendering of post\_install message by trimming unnecessary leading spaces [#89](https://github.com/voxpupuli/metadata-json-lint/pull/89) * Fail when checking version requirements if the version range is empty [#91](https://github.com/voxpupuli/metadata-json-lint/pull/91) * Pin `public_suffix` gem to < 3 for Ruby <= 2.0 [#93](https://github.com/voxpupuli/metadata-json-lint/pull/93) ### Fixed * Prevent metadata-json-lint from crashing when the `requirements` field does not contain an array [#94](https://github.com/voxpupuli/metadata-json-lint/pull/94) * Fix loading of `semantic_puppet` so that it supports using version vendored in Puppet (if available) [#96](https://github.com/voxpupuli/metadata-json-lint/pull/96) ## 2.0.2 ### Changes * Make SemanticPuppet completely optional and remove dependency on Puppet [#86](https://github.com/voxpupuli/metadata-json-lint/pull/86) * Only log open dependency warning with --strict-dependencies [#78](https://github.com/voxpupuli/metadata-json-lint/pull/78) ### Fixed * Fix readme for gemfile usage [#84](https://github.com/voxpupuli/metadata-json-lint/pull/84) ## 2.0.1 ### Changes * Puppet 4.9.0 and newer uses the vendored `semantic_puppet` packaged with Puppet. * If using Puppet 4.8.x and earlier, adding `semantic_puppet` to your Gemfile is required as the vendored `semantic_puppet` was not packaged with Puppet prior to `4.9.0` * Add test environment for Ruby 2.4.1 ## 2.0.0 ### Changes * The `semantic_puppet` gem is no longer included as a runtime dependency due to conflicts with Puppet 5.x libraries that break the `puppet module` command. As such, `semantic_puppet` must be added to a user's Gemfile in Puppet <= 4.x. See [Installation](https://github.com/voxpupuli/metadata-json-lint#installation) docs for more info * `metadata-json-lint` now officially only supports Ruby >= 2.0.0 ### Fixed * Fix puppet 5.x `semantic_puppet` conflicts ([#79](https://github.com/voxpupuli/metadata-json-lint/issues/79)) * Clarify Ruby >= 2.x only support ([#74](https://github.com/voxpupuli/metadata-json-lint/issues/74)) ## 1.2.2 ### Fixed * Fix `metadata_lint` rake task exiting on success, not continuing ([#70](https://github.com/voxpupuli/metadata-json-lint/issues/70)) * Fix failure on incorrect license warning when `--no-strict-license` used ([#69](https://github.com/voxpupuli/metadata-json-lint/issues/69)) ## 1.2.1 ### Fixed * Fix missing lib/ files in published gem ## 1.2.0 ### Added * Add `--format`/`-f` option to support a JSON output format * Add warning for mixed version range syntax, supported only in Puppet 5 ### Changed * The default text format mode now outputs more structured messages * README has been edited and clarity improved ### Fixed * Fix non-zero exit code caused by some checks ## 1.1.0 ### Added * Ensure module `tags` are correctly specified as an array ([#44](https://github.com/voxpupuli/metadata-json-lint/issues/44)) * Ensure `requirements` doesn't list the deprecated `pe` key ([#46](https://github.com/voxpupuli/metadata-json-lint/issues/46)) * Ensure `dependencies` aren't listed with `version_range` keys ([#47](https://github.com/voxpupuli/metadata-json-lint/issues/47)) * Support strictness configuration via Ruby API, for use in rake tasks definitions * Show default strictness option values in `--help` output ### Fixed * Fix unclear error message when metadata.json does not exist * Fix gem publishing date * Various test improvements, ensuring failures are caught accurately and precisely metadata-json-lint-3.0.0/Gemfile0000644000175000017500000000016413767734463016365 0ustar gabstergabstersource 'https://rubygems.org' gemspec group :release do gem 'github_changelog_generator', :require => false end metadata-json-lint-3.0.0/CHANGELOG.md0000644000175000017500000001174113767734463016706 0ustar gabstergabster# Changelog All notable changes to this project will be documented in this file. ## [v3.0.0](https://github.com/voxpupuli/metadata-json-lint/tree/v3.0.0) (2020-11-23) [Full Changelog](https://github.com/voxpupuli/metadata-json-lint/compare/2.4.0...v3.0.0) **Merged pull requests:** - Require Ruby 2.1 and drop post\_install\_message [\#112](https://github.com/voxpupuli/metadata-json-lint/pull/112) ([ekohl](https://github.com/ekohl)) ## [2.4.0](https://github.com/voxpupuli/metadata-json-lint/tree/2.4.0) (2020-06-12) [Full Changelog](https://github.com/voxpupuli/metadata-json-lint/compare/2.3.0...2.4.0) **Merged pull requests:** - Add ruby 2.7 to test matrix [\#110](https://github.com/voxpupuli/metadata-json-lint/pull/110) ([DavidS](https://github.com/DavidS)) - Publish gem only on one rvm job [\#109](https://github.com/voxpupuli/metadata-json-lint/pull/109) ([bastelfreak](https://github.com/bastelfreak)) ## 2.3.0 * Add duplicate testing in requirements list * Fix wrong license file content so GitHub can properly detect it * Fix a typo in the README.md ## 2.2.0 * Validate Puppet version_requirement [#99](https://github.com/voxpupuli/metadata-json-lint/issues/99) * Add optional check `--strict-puppet-version` to validate the Puppet Agent Version is not EOL or open ended [#100](https://github.com/voxpupuli/metadata-json-lint/pull/100) ## 2.1.0 ### Changes * Improve rendering of post\_install message by trimming unnecessary leading spaces [#89](https://github.com/voxpupuli/metadata-json-lint/pull/89) * Fail when checking version requirements if the version range is empty [#91](https://github.com/voxpupuli/metadata-json-lint/pull/91) * Pin `public_suffix` gem to < 3 for Ruby <= 2.0 [#93](https://github.com/voxpupuli/metadata-json-lint/pull/93) ### Fixed * Prevent metadata-json-lint from crashing when the `requirements` field does not contain an array [#94](https://github.com/voxpupuli/metadata-json-lint/pull/94) * Fix loading of `semantic_puppet` so that it supports using version vendored in Puppet (if available) [#96](https://github.com/voxpupuli/metadata-json-lint/pull/96) ## 2.0.2 ### Changes * Make SemanticPuppet completely optional and remove dependency on Puppet [#86](https://github.com/voxpupuli/metadata-json-lint/pull/86) * Only log open dependency warning with --strict-dependencies [#78](https://github.com/voxpupuli/metadata-json-lint/pull/78) ### Fixed * Fix readme for gemfile usage [#84](https://github.com/voxpupuli/metadata-json-lint/pull/84) ## 2.0.1 ### Changes * Puppet 4.9.0 and newer uses the vendored `semantic_puppet` packaged with Puppet. * If using Puppet 4.8.x and earlier, adding `semantic_puppet` to your Gemfile is required as the vendored `semantic_puppet` was not packaged with Puppet prior to `4.9.0` * Add test environment for Ruby 2.4.1 ## 2.0.0 ### Changes * The `semantic_puppet` gem is no longer included as a runtime dependency due to conflicts with Puppet 5.x libraries that break the `puppet module` command. As such, `semantic_puppet` must be added to a user's Gemfile in Puppet <= 4.x. See [Installation](https://github.com/voxpupuli/metadata-json-lint#installation) docs for more info * `metadata-json-lint` now officially only supports Ruby >= 2.0.0 ### Fixed * Fix puppet 5.x `semantic_puppet` conflicts ([#79](https://github.com/voxpupuli/metadata-json-lint/issues/79)) * Clarify Ruby >= 2.x only support ([#74](https://github.com/voxpupuli/metadata-json-lint/issues/74)) ## 1.2.2 ### Fixed * Fix `metadata_lint` rake task exiting on success, not continuing ([#70](https://github.com/voxpupuli/metadata-json-lint/issues/70)) * Fix failure on incorrect license warning when `--no-strict-license` used ([#69](https://github.com/voxpupuli/metadata-json-lint/issues/69)) ## 1.2.1 ### Fixed * Fix missing lib/ files in published gem ## 1.2.0 ### Added * Add `--format`/`-f` option to support a JSON output format * Add warning for mixed version range syntax, supported only in Puppet 5 ### Changed * The default text format mode now outputs more structured messages * README has been edited and clarity improved ### Fixed * Fix non-zero exit code caused by some checks ## 1.1.0 ### Added * Ensure module `tags` are correctly specified as an array ([#44](https://github.com/voxpupuli/metadata-json-lint/issues/44)) * Ensure `requirements` doesn't list the deprecated `pe` key ([#46](https://github.com/voxpupuli/metadata-json-lint/issues/46)) * Ensure `dependencies` aren't listed with `version_range` keys ([#47](https://github.com/voxpupuli/metadata-json-lint/issues/47)) * Support strictness configuration via Ruby API, for use in rake tasks definitions * Show default strictness option values in `--help` output ### Fixed * Fix unclear error message when metadata.json does not exist * Fix gem publishing date * Various test improvements, ensuring failures are caught accurately and precisely \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* metadata-json-lint-3.0.0/.travis.yml0000644000175000017500000000107713767734463017207 0ustar gabstergabster--- language: ruby script: - bundle exec rake test rvm: - 2.1 - 2.4 - 2.5 - 2.6 - 2.7 deploy: provider: rubygems api_key: secure: Rm6j/fS5n4TyqmqftwMj2Ebw0avsuDbuI9wVX4exUNiuQRru967QPrQinMuAwBGLCNYMs69ZHFBMkpk61khQGC3W7d5Yr/25HabnQBFpfO2llHhKKgM/Ckyqur+ku88EVJH9nRCDqOprJtC4RGHIA833ENL8xVP/VOvfiKG0Q14= gem: metadata-json-lint on: tags: true rvm: 2.7 repo: voxpupuli/metadata-json-lint notifications: email: false irc: on_success: always on_failure: always channels: - "chat.freenode.org#voxpupuli-notifications" metadata-json-lint-3.0.0/.rubocop_todo.yml0000644000175000017500000000113013767734463020363 0ustar gabstergabster# This configuration was generated by # `rubocop --auto-gen-config` # on 2015-10-08 14:05:42 -0700 using RuboCop version 0.34.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. # Offense count: 1 Lint/RescueException: Exclude: - 'lib/metadata_json_lint.rb' # Offense count: 1 # Configuration parameters: Exclude. Style/Documentation: Exclude: - 'lib/metadata_json_lint.rb' metadata-json-lint-3.0.0/.rubocop.yml0000644000175000017500000000067413767734463017352 0ustar gabstergabsterinherit_from: .rubocop_todo.yml # we still support ruby 1.8 Style/HashSyntax: Enabled: false #Metric cops are rarely useful Metrics/AbcSize: Enabled: false Metrics/CyclomaticComplexity: Enabled: false Metrics/LineLength: Enabled: false Metrics/MethodLength: Enabled: false Metrics/BlockLength: Exclude: - spec/**/*_spec.rb - ./*.gemspec Metrics/PerceivedComplexity: Enabled: false Metrics/ModuleLength: Max: 185 metadata-json-lint-3.0.0/.rspec0000644000175000017500000000002613767734463016204 0ustar gabstergabster--require spec_helper metadata-json-lint-3.0.0/.gitignore0000644000175000017500000000011713767734463017060 0ustar gabstergabster*.sw? *.gem Gemfile.lock /.bundle /vendor tests/*/last_*output .idea/ .vendor/