author | Jan Vrany <jan.vrany@labware.com> |
Wed, 15 Sep 2021 21:39:40 +0100 | |
branch | jv |
changeset 19608 | 98f7cba0ce8c |
parent 18532 | cccb41254edf |
permissions | -rw-r--r-- |
18532
cccb41254edf
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
12431
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
cccb41254edf
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
12431
diff
changeset
|
2 |
|
7770 | 3 |
" |
4 |
COPYRIGHT (c) 2007 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libtool' }" |
|
15 |
||
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
Object subclass:#CodeCritics |
|
19 |
instanceVariableNames:'code critics' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Interface-Browsers-New' |
|
23 |
! |
|
24 |
||
25 |
!CodeCritics class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 2007 by eXept Software AG |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
extracted critics from the browser |
|
44 |
For now, not much is found here - however, it will eventually grow and should collect |
|
45 |
the critics in the parser as well. |
|
46 |
||
47 |
[author:] |
|
48 |
Claus Gittinger (cg@exept.de) |
|
49 |
" |
|
50 |
! ! |
|
51 |
||
52 |
!CodeCritics class methodsFor:'critics'! |
|
53 |
||
54 |
checkCodeQuality:code |
|
55 |
^ (self new code:code) checkCodeQuality |
|
56 |
||
57 |
"Created: / 27-03-2007 / 21:41:50 / cg" |
|
58 |
! ! |
|
59 |
||
60 |
!CodeCritics methodsFor:'accessing'! |
|
61 |
||
62 |
code:something |
|
63 |
code := something. |
|
64 |
! ! |
|
65 |
||
66 |
!CodeCritics methodsFor:'critics'! |
|
67 |
||
7780 | 68 |
checkBadIndentationOfReturns |
69 |
"we want returns to be indented correctly" |
|
7770 | 70 |
|
71 |
code asCollectionOfLines keysAndValuesDo:[:lineNr :eachLine | |
|
72 |
|lineString column| |
|
73 |
||
74 |
lineString := eachLine string. |
|
75 |
(lineString withoutLeadingSeparators startsWith:'^') ifTrue:[ |
|
76 |
column := lineString indexOf:$^. |
|
77 |
(column-1) \\ 4 ~~ 0 ifTrue:[ |
|
78 |
self addCritic:'bad indentation' line:lineNr. |
|
79 |
]. |
|
80 |
] |
|
81 |
]. |
|
82 |
||
83 |
"Created: / 27-03-2007 / 21:41:10 / cg" |
|
84 |
! |
|
85 |
||
86 |
checkCodeQuality |
|
87 |
self checkBadIndentationOfReturns. |
|
88 |
^ critics |
|
89 |
||
90 |
"Created: / 27-03-2007 / 21:42:11 / cg" |
|
91 |
! ! |
|
92 |
||
7780 | 93 |
!CodeCritics methodsFor:'helpers'! |
94 |
||
95 |
addCritic:msg line:lineNr |
|
96 |
critics isNil ifTrue:[ |
|
97 |
critics := OrderedCollection new. |
|
98 |
]. |
|
99 |
critics add:(lineNr -> msg) |
|
100 |
||
101 |
"Created: / 27-03-2007 / 21:47:09 / cg" |
|
102 |
! ! |
|
103 |
||
7770 | 104 |
!CodeCritics class methodsFor:'documentation'! |
105 |
||
10033 | 106 |
version_CVS |
18532
cccb41254edf
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
12431
diff
changeset
|
107 |
^ '§Header: /cvs/stx/stx/libtool/Tools__CodeCritics.st,v 1.3 2011/07/03 13:31:36 cg Exp §' |
10033 | 108 |
! |
109 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
110 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
111 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
112 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
113 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
114 |
|
10033 | 115 |
version_SVN |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12123
diff
changeset
|
116 |
^ '$Id: Tools__CodeCritics.st 7854 2012-01-30 17:49:41Z vranyj1 $' |
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
117 |
! ! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
118 |