texqc 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6417dba6502ed4e98ee381614ada43663890850be482dc3e7f4dc30b72b8d25
4
- data.tar.gz: 36a4e4704d3f35c92a7ab5ae66ced90d33f83cf96bea35c2138aaf526ea70095
3
+ metadata.gz: 9c12e0ba9d77a13db9351a12a90b3cbf7e810395f4bfdc76554379dc11482cac
4
+ data.tar.gz: 9a3cbce31372740a8fd4536292d344ba215c88ee94fd41ff7287af71b98c06ce
5
5
  SHA512:
6
- metadata.gz: b61800ce2230eb64d841be40bc6dcabc6eeb4359878c7225b16be4cb1539c5812f90493e190ca02b2b20838a3d15ad8289ec30198b7ae1483824cfa4601b6244
7
- data.tar.gz: 6b2481529eb732483a68acf882a8311c15088658d6e5b04bed6a766e4a89f8f33b20fda47f08852baaa1e84fd3b9f9696b9d5d54a3d35fa0208f65d10f78a67b
6
+ metadata.gz: b5962c8ea292889abf464d25369aafc397e2421c30b7df570d9867cecf38bcb2bec886bdd3cb55ee7f20517fb97611c286bff7dfb9a6512638049a89cc012748
7
+ data.tar.gz: 62259304c62075c3f8fdd359fe43f43984f60d08323e3303ccc19e6557059b3143e49c6f1ba3d13f0e7b76056ac17e7a3346f85f24b0ff702b98d08a797b87e8
data/README.md CHANGED
@@ -32,6 +32,11 @@ $ texqc article
32
32
  If any warnings were reported by LaTeX, you will get a short list of them
33
33
  and the exit code will be non-zero (very convenient for your CI/CD scripts).
34
34
 
35
+ To make configuration easier, you can create `.texqc` file next to your
36
+ `.tex` file and place all your command line configuration options over there,
37
+ each one on its own line. You can also have a global configuration file
38
+ at `~/.texqc`, which will be read first.
39
+
35
40
  ## How to contribute
36
41
 
37
42
  Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
data/bin/texqc CHANGED
@@ -21,7 +21,7 @@
21
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  # SOFTWARE.
23
23
 
24
- VERSION = '0.6.0'
24
+ VERSION = '0.8.0'
25
25
 
26
26
  STDOUT.sync = true
27
27
 
@@ -43,10 +43,22 @@ class Errors
43
43
  end
44
44
  end
45
45
 
46
+ def config(path)
47
+ f = File.expand_path(path)
48
+ args = []
49
+ if File.exist?(f)
50
+ args += File.readlines(f).map(&:strip)
51
+ puts "Found #{args.length} lines in #{File.absolute_path(f)}"
52
+ end
53
+ args
54
+ end
55
+
46
56
  begin
47
57
  log = Loog::REGULAR
58
+ args = config('~/.texqc') + config('.texqc') + ARGV
59
+
48
60
  begin
49
- opts = Slop.parse(ARGV, strict: true, help: true) do |o|
61
+ opts = Slop.parse(args, strict: true, help: true) do |o|
50
62
  o.banner = "Usage (#{VERSION}): texqc [options] file...
51
63
  Options are:"
52
64
  o.bool '--dry', 'Don\'t fail the build on errors'
@@ -68,6 +80,9 @@ Options are:"
68
80
  end
69
81
  candidates = opts.arguments
70
82
  candidates += Dir['*.tex'] if candidates.empty?
83
+ puts "Args: #{args}" if opts[:verbose]
84
+ puts "Ignore: #{opts[:ignore]}" if opts[:verbose]
85
+ puts "Candidates: #{candidates}" if opts[:verbose]
71
86
  candidates.each do |doc|
72
87
  if doc.end_with?('.tex')
73
88
  log.info("File extention removed from #{doc.inspect}")
data/features/cli.feature CHANGED
@@ -56,3 +56,21 @@ Feature: Command Line Processing
56
56
  When I run bash with "pdflatex article.tex"
57
57
  Then I run bin/texqc with "--ignore 'may have changed' article.tex"
58
58
  Then Exit code is zero
59
+
60
+ Scenario: Bad LaTeX log output checked with LaTeX warning, but ignored with .texqc
61
+ Given I have a "article.tex" file with content:
62
+ """
63
+ \documentclass{article}
64
+ \begin{document}
65
+ test\label{xxx}test\label{xxx}
66
+ \end{document}
67
+ """
68
+ And I have a ".texqc" file with content:
69
+ """
70
+ --verbose
71
+
72
+ --ignore='may have changed'
73
+ """
74
+ When I run bash with "pdflatex article.tex"
75
+ Then I run bin/texqc
76
+ Then Exit code is zero
data/texqc.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.rubygems_version = '2.2'
33
33
  s.required_ruby_version = '>= 2.3'
34
34
  s.name = 'texqc'
35
- s.version = '0.6.0'
35
+ s.version = '0.8.0'
36
36
  s.license = 'MIT'
37
37
  s.summary = 'Quality Control of Your LaTeX Build'
38
38
  s.description = 'Run it after you compile your LaTeX document'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texqc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
11
+ date: 2021-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace