Skip to content

Instantly share code, notes, and snippets.

@sumyapp
sumyapp / goodcheck.yml
Created March 16, 2018 02:45
Goodcheck Config exmaple for PHP
rules:
- id: com.example.mysql
pattern: mysql_*
message: |
Do not use mysql_* functions.
Please use PDO or Framework's ORM.
MySQL Functions (PDO_MYSQL)
http://php.net/manual/en/ref.pdo-mysql.php
glob:
- "**/*.php"
@sumyapp
sumyapp / eslint_warn_count.rb
Last active October 20, 2016 01:52
ESLintの出力JSONファイルを読み込み、指摘が1件以上あるルールを発見し、設定ファイルとして出力する。指摘件数はJSONコメントで記載される
require 'json'
input_file = 'eslint_result.json'
output_file = 'eslint_todo.json'
array = JSON.parse open(input_file, &:read)
rules_counts = {}
array.each do |file|
next if file['errorCount'] == 0 && file['warningCount'] == 0
file['messages'].each do |message|
require 'json'
input_file = 'eslint_result.json'
output_file = 'eslint_todo.json'
array = JSON.parse open(input_file, &:read)
rules_counts = {}
array.each do |file|
next if file['errorCount'] == 0 && file['warningCount'] == 0
file['messages'].each do |message|
class Dirty
# This method smells of :reek:NestedIterators but ignores them
def awful(x, y, offset = 0, log = false)
puts @screen.title
@screen = widgets.map { |w| w.each { |key| key += 3 * x } }
puts @screen.contents
puts @screen.contents
puts @screen.contents
puts @screen.contents
puts @screen.contents