bigfiles 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0caad8f9e5834f2cc41fb3cae5173e95b1b90fc9195cc131fd5f133ee3656bb
4
- data.tar.gz: 3702722ad9c05ffe9700eafc0d6625f50b60a78138b035ce0efb2c7f19e0b94d
3
+ metadata.gz: c625f268823284a5c9058cd51515ef8127f8ef58c61ad1e4c6c01f79bc89d9a9
4
+ data.tar.gz: 4938c301bb8d5c9064e797b4a92495a422a90a5c58c32bc2fc03103703e3a694
5
5
  SHA512:
6
- metadata.gz: ee1c3c9f1b3a203673d0866e3c540d9161f05f4f11158d7c18705265666eb82229cecf06fb2f7f0c91dc03de96d643a384ba95fcbdbe5b7f3b69b7e1ebfebecf
7
- data.tar.gz: 7543754c3642a29ee01c7e692624295d1e6eedf67ec275ba73042c0f97ece8c5fe41e407bc653289dc3dc387fe03ae2516105f3672b44063c6da91252b350429
6
+ metadata.gz: '08cc96dc7153ffbc18623d2deea513d39ff0df1c67d16fddaa62c81406bafd68c9e05bf9f416a54c87580d865fa3f3214088afb83106edf92e410b7a27ba525d'
7
+ data.tar.gz: b9415c5f66f9e8120425aea6a730c8e89b529e9bd3eebbc7e6a77ebfaff06f003e867ad9866c4fff5d700595c6dcde51abf2bee63230e977f81baa35e2308bb0
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ rule 'MD029', style: 'ordered'
data/.mdlrc ADDED
@@ -0,0 +1 @@
1
+ style ".markdownlint_style.rb"
data/CONTRIBUTING.rst ADDED
@@ -0,0 +1,75 @@
1
+ ============
2
+ Contributing
3
+ ============
4
+
5
+ Contributions are welcome, and they are greatly appreciated! Every little bit
6
+ helps, and credit will always be given.
7
+
8
+ You can contribute in many ways:
9
+
10
+ Types of Contributions
11
+ ----------------------
12
+
13
+ Report Bugs
14
+ ~~~~~~~~~~~
15
+
16
+ Report bugs at https://github.com/apiology/bigfiles/issues
17
+
18
+ If you are reporting a bug, please include:
19
+
20
+ * Your operating system name and version.
21
+ * Any details about your local setup that might be helpful in troubleshooting.
22
+ * Detailed steps to reproduce the bug.
23
+
24
+ Fix Bugs
25
+ ~~~~~~~~
26
+
27
+ Look through the GitHub issues for bugs. Anything tagged with "bug"
28
+ and "help wanted" is open to whoever wants to implement a fix for it.
29
+
30
+ Implement Features
31
+ ~~~~~~~~~~~~~~~~~~
32
+
33
+ Look through the GitHub issues for features. Anything tagged with "enhancement"
34
+ and "help wanted" is open to whoever wants to implement it.
35
+
36
+ If you have a new feature in mind, please start it by filing an issue
37
+ so we can discuss the need and approach before you invest time into
38
+ coding it.
39
+
40
+ Write Documentation
41
+ ~~~~~~~~~~~~~~~~~~~
42
+
43
+ BigFiles could always use more documentation, whether as part of
44
+ the official BigFiles docs, in docstrings, or even on the web in blog posts, articles,
45
+ and such.
46
+
47
+ Submit Feedback
48
+ ~~~~~~~~~~~~~~~
49
+
50
+ The best way to send feedback is to file an issue at
51
+ https://github.com/apiology/bigfiles/issues.
52
+
53
+ If you are proposing a new feature:
54
+
55
+ * Explain in detail how it would work.
56
+ * Keep the scope as narrow as possible, to make it easier to implement.
57
+ * Remember that this is a volunteer-driven project, and that contributions
58
+ are welcome :)
59
+
60
+ Get Started!
61
+ ------------
62
+
63
+ Ready to contribute? See DEVELOPMENT.md in this directory for details
64
+ on how to set yourself up for local development.
65
+
66
+ Pull Request Guidelines
67
+ -----------------------
68
+
69
+ Before you submit a pull request, check that it meets these guidelines:
70
+
71
+ 1. The pull request should include tests.
72
+
73
+ 2. If the pull request adds functionality, the docs should be updated. Put your
74
+ new functionality into a function with a docstring, and add the feature to
75
+ the list in README.md.
data/DEVELOPMENT.md CHANGED
@@ -27,4 +27,5 @@ git log "v$(bump current)..."
27
27
  bump --tag --tag-prefix=v ${type_of_bump:?}
28
28
  rake release
29
29
  git push
30
+ git push --tags
30
31
  ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bigfiles (0.2.2)
4
+ bigfiles (0.3.0)
5
5
  high_water_mark
6
6
  source_finder (>= 2)
7
7
 
@@ -10,22 +10,42 @@ GEM
10
10
  specs:
11
11
  ast (2.4.2)
12
12
  bump (0.10.0)
13
+ chef-utils (17.10.0)
14
+ concurrent-ruby
13
15
  childprocess (4.1.0)
14
16
  coderay (1.1.3)
15
- diff-lcs (1.4.4)
17
+ concurrent-ruby (1.1.10)
18
+ diff-lcs (1.5.0)
16
19
  docile (1.4.0)
17
20
  ffi (1.15.4-java)
18
21
  high_water_mark (0.1.0)
19
22
  imagen (0.1.8)
20
23
  parser (>= 2.5, != 2.5.1.1)
21
24
  iniparse (1.5.0)
25
+ json (2.6.2)
26
+ json (2.6.2-java)
27
+ kramdown (2.4.0)
28
+ rexml
29
+ kramdown-parser-gfm (1.1.0)
30
+ kramdown (~> 2.0)
31
+ mdl (0.11.0)
32
+ kramdown (~> 2.3)
33
+ kramdown-parser-gfm (~> 1.1)
34
+ mixlib-cli (~> 2.1, >= 2.1.1)
35
+ mixlib-config (>= 2.2.1, < 4)
36
+ mixlib-shellout
22
37
  method_source (1.0.0)
23
- overcommit (0.58.0)
38
+ mixlib-cli (2.1.8)
39
+ mixlib-config (3.0.27)
40
+ tomlrb
41
+ mixlib-shellout (3.2.7)
42
+ chef-utils
43
+ overcommit (0.59.1)
24
44
  childprocess (>= 0.6.3, < 5)
25
45
  iniparse (~> 1.4)
26
46
  rexml (~> 3.2)
27
- parallel (1.21.0)
28
- parser (3.0.2.0)
47
+ parallel (1.22.1)
48
+ parser (3.1.2.0)
29
49
  ast (~> 2.4.1)
30
50
  pry (0.14.1)
31
51
  coderay (~> 1.1)
@@ -34,40 +54,41 @@ GEM
34
54
  coderay (~> 1.1)
35
55
  method_source (~> 1.0)
36
56
  spoon (~> 0.0)
37
- rainbow (3.0.0)
57
+ rainbow (3.1.1)
38
58
  rake (13.0.6)
39
- regexp_parser (2.1.1)
59
+ regexp_parser (2.5.0)
40
60
  rexml (3.2.5)
41
- rspec (3.10.0)
42
- rspec-core (~> 3.10.0)
43
- rspec-expectations (~> 3.10.0)
44
- rspec-mocks (~> 3.10.0)
45
- rspec-core (3.10.1)
46
- rspec-support (~> 3.10.0)
47
- rspec-expectations (3.10.1)
61
+ rspec (3.11.0)
62
+ rspec-core (~> 3.11.0)
63
+ rspec-expectations (~> 3.11.0)
64
+ rspec-mocks (~> 3.11.0)
65
+ rspec-core (3.11.0)
66
+ rspec-support (~> 3.11.0)
67
+ rspec-expectations (3.11.0)
48
68
  diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.10.0)
50
- rspec-mocks (3.10.2)
69
+ rspec-support (~> 3.11.0)
70
+ rspec-mocks (3.11.1)
51
71
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.10.0)
53
- rspec-support (3.10.3)
54
- rubocop (1.23.0)
72
+ rspec-support (~> 3.11.0)
73
+ rspec-support (3.11.0)
74
+ rubocop (1.31.2)
75
+ json (~> 2.3)
55
76
  parallel (~> 1.10)
56
- parser (>= 3.0.0.0)
77
+ parser (>= 3.1.0.0)
57
78
  rainbow (>= 2.2.2, < 4.0)
58
79
  regexp_parser (>= 1.8, < 3.0)
59
- rexml
60
- rubocop-ast (>= 1.12.0, < 2.0)
80
+ rexml (>= 3.2.5, < 4.0)
81
+ rubocop-ast (>= 1.18.0, < 2.0)
61
82
  ruby-progressbar (~> 1.7)
62
83
  unicode-display_width (>= 1.4.0, < 3.0)
63
- rubocop-ast (1.13.0)
64
- parser (>= 3.0.1.1)
84
+ rubocop-ast (1.18.0)
85
+ parser (>= 3.1.1.0)
65
86
  rubocop-rake (0.6.0)
66
87
  rubocop (~> 1.0)
67
- rubocop-rspec (2.6.0)
68
- rubocop (~> 1.19)
88
+ rubocop-rspec (2.12.1)
89
+ rubocop (~> 1.31)
69
90
  ruby-progressbar (1.11.0)
70
- rugged (1.1.1)
91
+ rugged (1.2.0)
71
92
  simplecov (0.21.2)
72
93
  docile (~> 1.1)
73
94
  simplecov-html (~> 0.11)
@@ -78,11 +99,12 @@ GEM
78
99
  source_finder (3.2.1)
79
100
  spoon (0.0.6)
80
101
  ffi
81
- undercover (0.4.3)
102
+ tomlrb (2.0.3)
103
+ undercover (0.4.4)
82
104
  imagen (>= 0.1.8)
83
105
  rainbow (>= 2.1, < 4.0)
84
- rugged (>= 0.27, < 1.2)
85
- unicode-display_width (2.1.0)
106
+ rugged (>= 0.27, < 1.3)
107
+ unicode-display_width (2.2.0)
86
108
 
87
109
  PLATFORMS
88
110
  java
@@ -95,6 +117,7 @@ DEPENDENCIES
95
117
  bigfiles!
96
118
  bump
97
119
  bundler
120
+ mdl
98
121
  overcommit (>= 0.58.0)
99
122
  pry
100
123
  rake (~> 13.0)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2013-2021, Vince Broz
3
+ Copyright (c) 2013-2022, Vince Broz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/Makefile CHANGED
@@ -41,6 +41,8 @@ clean: clear_metrics ## remove all built artifacts
41
41
 
42
42
  test: spec ## run tests quickly
43
43
 
44
+ typecheck: ## validate types in code and configuration
45
+
44
46
  overcommit: ## run precommit quality checks
45
47
  bundle exec overcommit --run
46
48
 
data/README.md CHANGED
@@ -40,6 +40,34 @@ $ bigfiles
40
40
  $
41
41
  ```
42
42
 
43
+ ## Options
44
+
45
+ You can control what files are included and excluded, and how many files are reported:
46
+
47
+ ```sh
48
+ $ bigfiles --help
49
+ Usage: bigfiles [options]
50
+ -g, --glob glob here Which files to parse - default is {Dockerfile,Rakefile,{*,.*}.{c,clj,cljs,cpp,gemspec,groovy,html,java,js,json,py,rake,rb,scala,sh,swift,yml},{app,config,db,feature,lib,spec,src,test,tests,vars,www}/**/{*,.*}.{c,clj,cljs,cpp,gemspec,groovy,html,java,js,json,py,rake,rb,scala,sh,swift,yml}}
51
+ -e, --exclude-glob glob here Files to exclude - default is none
52
+ -h, --help This message
53
+ -n, --num-files number-here Top number of files to show--default 3
54
+ $
55
+ ```
56
+
57
+ ## Configuration
58
+
59
+ You can set different defaults for the above in a `.bigfiles.yml` in the current directory:
60
+
61
+ ```yaml
62
+ ---
63
+ bigfiles:
64
+ num_files: 8
65
+ include:
66
+ glob: '**/*.my-favorite-extension'
67
+ exclude:
68
+ glob: fix.sh
69
+ ```
70
+
43
71
  ## Contributing
44
72
 
45
73
  Bug reports and pull requests are welcome on
@@ -58,3 +86,15 @@ The gem is available as open source under the terms of the
58
86
  Everyone interacting in the Pronto::Punchlist project’s codebases,
59
87
  issue trackers, chat rooms and mailing lists is expected to follow the
60
88
  [code of conduct](https://github.com/apiology/bigfiles/blob/main/CODE_OF_CONDUCT.md).
89
+
90
+ ## Contributions
91
+
92
+ This project, as with all others, rests on the shoulders of a broad
93
+ ecosystem supported by many volunteers doing thankless work, along
94
+ with specific contributors.
95
+
96
+ In particular I'd like to call out:
97
+
98
+ * [Audrey Roy Greenfeld](https://github.com/audreyfeldroy) for the
99
+ cookiecutter tool and associated examples, which keep my many
100
+ projects building with shared boilerplate with a minimum of fuss.
data/bigfiles.gemspec CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_development_dependency 'bump'
31
31
  spec.add_development_dependency 'bundler'
32
+ spec.add_development_dependency 'mdl'
32
33
  # 0.58.0 and 0.57.0 don't seem super compatible with signatures, and
33
34
  # magit doesn't seem to want to use the bundled version at the moment,
34
35
  # so let's favor the more recent version...
data/fix.sh CHANGED
@@ -284,12 +284,7 @@ ensure_python_versions() {
284
284
  }
285
285
 
286
286
  major_minor="$(cut -d. -f1-2 <<<"${ver}")"
287
- if [ "${major_minor}" == 3.6 ]
288
- then
289
- pyenv_install --patch "${ver}" < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index=1)
290
- else
291
- pyenv_install "${ver}"
292
- fi
287
+ pyenv_install "${ver}"
293
288
  else
294
289
  pyenv install -s "${ver}"
295
290
  fi
@@ -307,12 +302,12 @@ ensure_pyenv_virtualenvs() {
307
302
  }
308
303
 
309
304
  ensure_pip_and_wheel() {
310
- # Make sure we have a pip with the 20.3 resolver, and after the
311
- # initial bugfix release
305
+ # pip 22 seems to be better at finding pandas pre-compiled wheels
306
+ # for macOS, so let's make sure we're using at least that version
312
307
  major_pip_version=$(pip --version | cut -d' ' -f2 | cut -d '.' -f 1)
313
308
  if [[ major_pip_version -lt 21 ]]
314
309
  then
315
- pip install 'pip>=20.3.1'
310
+ pip install 'pip>=22'
316
311
  fi
317
312
  # wheel is helpful for being able to cache long package builds
318
313
  pip show wheel >/dev/null 2>&1 || pip install wheel
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+
5
+ module BigFiles
6
+ # Load configuration from files
7
+ class ConfigFileParser
8
+ attr_reader :project_config_filename
9
+
10
+ def initialize(project_config_filename = '.bigfiles.yml',
11
+ yaml_class: YAML,
12
+ file_class: File)
13
+ @project_config_filename = project_config_filename
14
+ @yaml_class = yaml_class
15
+ @file_class = file_class
16
+ end
17
+
18
+ def parse_config_files
19
+ config = {}
20
+ project_config = parse_project_config
21
+ config.merge(project_config)
22
+ end
23
+
24
+ private
25
+
26
+ def item(raw_project_config, section, key)
27
+ raw_project_config.fetch('bigfiles', {}).fetch(section, {}).fetch(key, nil)
28
+ end
29
+
30
+ def top_item(raw_project_config, key)
31
+ raw_project_config.fetch('bigfiles', {}).fetch(key, nil)
32
+ end
33
+
34
+ def parse_project_config
35
+ return {} unless @file_class.file? project_config_filename
36
+
37
+ project_config = {}
38
+ raw_project_config = @yaml_class.load_file(project_config_filename)
39
+ exclude = item(raw_project_config, 'exclude', 'glob')
40
+ project_config[:exclude] = exclude unless exclude.nil?
41
+ glob = item(raw_project_config, 'include', 'glob')
42
+ project_config[:glob] = glob unless glob.nil?
43
+ num_files = top_item(raw_project_config, 'num_files')
44
+ project_config[:num_files] = num_files unless num_files.nil?
45
+ project_config
46
+ end
47
+ end
48
+ end
@@ -42,8 +42,7 @@ module BigFiles
42
42
  options = setup_options(opts)
43
43
  @option_parser = opts
44
44
  end.parse!(args)
45
- Config.new(**options,
46
- source_finder_option_parser: @source_finder_option_parser)
45
+ options
47
46
  end
48
47
 
49
48
  def usage
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Tool to find the largest source files in your project
4
4
  module BigFiles
5
- VERSION = '0.2.2'
5
+ VERSION = '0.3.0'
6
6
  end
data/lib/bigfiles.rb CHANGED
@@ -3,7 +3,9 @@
3
3
  require 'optparse'
4
4
 
5
5
  require 'bigfiles/file_with_lines'
6
+ require 'bigfiles/config_file_parser'
6
7
  require 'bigfiles/option_parser'
8
+ require 'bigfiles/config'
7
9
  require 'bigfiles/inspector'
8
10
  require 'bigfiles/version'
9
11
  require 'source_finder/source_file_globber'
@@ -21,6 +23,7 @@ module BigFiles
21
23
  inspector_class: Inspector,
22
24
  option_parser_class: ::OptionParser,
23
25
  source_finder_option_parser: SourceFinder::OptionParser.new,
26
+ yaml_class: YAML,
24
27
  bigfiles_option_parser:
25
28
  ::BigFiles::OptionParser
26
29
  .new(option_parser_class: option_parser_class,
@@ -28,7 +31,11 @@ module BigFiles
28
31
  exiter: exiter,
29
32
  source_finder_option_parser:
30
33
  source_finder_option_parser),
31
- config: bigfiles_option_parser.parse_options(args))
34
+ config_file_parser: ::BigFiles::ConfigFileParser.new(yaml_class: yaml_class),
35
+ raw_config: config_file_parser.parse_config_files
36
+ .merge(bigfiles_option_parser.parse_options(args)),
37
+ config: Config.new(**raw_config))
38
+
32
39
  @bigfiles_option_parser = bigfiles_option_parser
33
40
  @config = config
34
41
  @inspector = inspector_class.new(source_file_globber: source_file_globber,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigfiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: high_water_mark
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mdl
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: overcommit
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -219,11 +233,14 @@ files:
219
233
  - ".git-hooks/pre_commit/circle_ci.rb"
220
234
  - ".gitattributes"
221
235
  - ".gitignore"
236
+ - ".markdownlint_style.rb"
237
+ - ".mdlrc"
222
238
  - ".overcommit.yml"
223
239
  - ".rubocop.yml"
224
240
  - ".rubocop_todo.yml"
225
241
  - ".yamllint.yml"
226
242
  - CODE_OF_CONDUCT.md
243
+ - CONTRIBUTING.rst
227
244
  - DEVELOPMENT.md
228
245
  - Gemfile
229
246
  - Gemfile.lock
@@ -269,6 +286,7 @@ files:
269
286
  - fix.sh
270
287
  - lib/bigfiles.rb
271
288
  - lib/bigfiles/config.rb
289
+ - lib/bigfiles/config_file_parser.rb
272
290
  - lib/bigfiles/file_with_lines.rb
273
291
  - lib/bigfiles/inspector.rb
274
292
  - lib/bigfiles/option_parser.rb